Catalog/encoding-string-hash

Encoding

djb2 / sdbm hash API

Computes the classic djb2 or sdbm 32-bit string hash over bytes with exact 32-bit overflow semantics — used widely in legacy C hash tables. Answers 'What is the djb2 hash of this string?', 'Compute an sdbm hash.'

Price$0.01per request
MethodPOST
Route/v1/encoding/string-hash
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
djb2sdbmhashstring-hashnon-cryptographichashtable32-bitencoding
API URLhttps://x402.hexl.dev/v1/encoding/string-hash
Integration docs
Example request
{
  "value": "hello",
  "variant": "djb2"
}
Example response
{
  "variant": "djb2",
  "hash": 261238937,
  "hashHex": "0x0f923099",
  "byteLength": 5,
  "interpretation": "djb2 hash of 5 bytes = 0x0f923099."
}
Input schema
{
  "type": "object",
  "required": [
    "value"
  ],
  "properties": {
    "value": {
      "type": "string",
      "examples": [
        "hello"
      ]
    },
    "variant": {
      "type": "string",
      "enum": [
        "djb2",
        "sdbm"
      ]
    },
    "inputEncoding": {
      "type": "string",
      "examples": [
        "utf8",
        "hex",
        "base64"
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}