API Documentation

This documentation provides details on how to use the Hasher Technologies LLC API for secure cryptographic hashing operations.

API Base URL

Base URL: /api/v1

Hashing Endpoints

POST /hash/string
Hash a String

Computes a secure hash for the provided plain text string.

Request Body
{
  "content": "string to be hashed",
  "algorithm": "SHA256", // or "SHA512"
  "options": {
    "useSalt": true, // optional, default: true
    "includePrefix": true // optional, default: true
  }
}
Response
{
  "hash": "ALGORITHM$salt$hash"  // or "ALGORITHM$hash" or just "hash" depending on options
}
POST /hash/file
Hash a File

Computes a secure hash for file content provided as Base64 or Hex.

Request Body
{
  "content": "base64 or hex encoded file content",
  "algorithm": "SHA256", // or "SHA512"
  "fileEncoding": "Auto", // or "Base64" or "Hex"
  "options": {
    "useSalt": true, // optional, default: true
    "includePrefix": true // optional, default: true
  }
}
Response
{
  "hash": "ALGORITHM$salt$hash"  // or "ALGORITHM$hash" or just "hash" depending on options
}

Verification Endpoints

POST /verify/string
Verify a String

Verifies if the plain text matches the provided hash.

Request Body
{
  "content": "string to verify",
  "hash": "hash_string_with_optional_prefix"
}
Response
{
  "isMatch": true  // or false
}
POST /verify/file
Verify a File

Verifies if the file content matches the provided hash.

Request Body
{
  "content": "base64 or hex encoded file content",
  "hash": "hash_string_with_optional_prefix",
  "fileEncoding": "Auto" // or "Base64" or "Hex"
}
Response
{
  "isMatch": true  // or false
}

API Limits

Size Limits
  • Base64 encoded files: 15MB or less (original file size)
  • Hex encoded files: 10MB or less (original file size)
  • Strings: 20MB maximum

Error Handling

The API returns standard HTTP status codes and a structured error response when an error occurs:

{
  "error": {
    "code": "ERROR_CODE",
    "message": "A descriptive error message"
  }
}
Common Error Codes
  • INVALID_INPUT: The request input is invalid or malformed
  • INVALID_ALGORITHM: The requested hashing algorithm is not supported
  • INVALID_ENCODING: The file encoding is invalid or could not be detected
  • CONTENT_TOO_LARGE: The provided content exceeds the size limits
  • INTERNAL_ERROR: An unexpected server-side error occurred

Sample Code

C# Example
var client = new HttpClient();
var request = new
{
    content = "Hello, world!",
    algorithm = "SHA256",
    options = new
    {
        useSalt = true,
        includePrefix = true
    }
};

var response = await client.PostAsJsonAsync(
    "/api/v1/hash/string",
    request);
var result = await response.Content
    .ReadFromJsonAsync();
Console.WriteLine(result.hash);
JavaScript Example
fetch('/api/v1/hash/string', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    content: 'Hello, world!',
    algorithm: 'SHA256',
    options: {
      useSalt: true,
      includePrefix: true
    }
  })
})
.then(response => response.json())
.then(data => console.log(data.hash));