Catalog/text-hamming

Text

Hamming distance API

Computes the Hamming distance (count of differing positions) between two equal-length strings and lists the mismatch positions. Answers 'how many positions differ?', 'where exactly do these fixed-length codes diverge?'.

Price$0.01per request
MethodPOST
Route/v1/text/hamming
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
texthammingdistancebitwisepositionsstring-distancecodesfuzzy
API URLhttps://x402.hexl.dev/v1/text/hamming
Integration docs
Example request
{
  "a": "karolin",
  "b": "kathrin"
}
Example response
{
  "distance": 3,
  "length": 7,
  "similarity": 0.571429,
  "mismatchPositions": [
    2,
    3,
    4
  ]
}
Input schema
{
  "type": "object",
  "required": [
    "a",
    "b"
  ],
  "properties": {
    "a": {
      "type": "string",
      "examples": [
        "karolin"
      ]
    },
    "b": {
      "type": "string",
      "examples": [
        "kathrin"
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}