Examples
Count three substitutions in the classic string example
Byte distance counts changed positions, not insertions or deletions.
Input
karolin
kathrinExpected answer
3- Delimiter
- Unit
Byte- Input type
Raw string
Find a one-bit change in a two-byte packet
FF versus FE changes one bit in the second byte.
Input
00ff|00feExpected answer
1- Delimiter
|- Unit
Bit- Input type
Hex
Compare every bit in opposite byte values
Two opposite bytes differ in all 16 bit positions.
Input
0000|ffffExpected answer
16- Delimiter
|- Unit
Bit- Input type
Hex
Count changed bytes in two IPv4-style headers
Only the final byte differs; this is a short synthetic header fragment.
Input
45000014|45000028Expected answer
1- Delimiter
|- Unit
Byte- Input type
Hex
Separate byte changes from bit changes in ASCII
ASCII A and a differ by the single 0x20 bit.
Input
A|aExpected answer
1- Delimiter
|- Unit
Bit- Input type
Raw string
Format reference: Hamming Distance background and specification
Parameters
| Parameter | Default value | Input and choices |
|---|---|---|
| Delimiter | "\\n\\n" | Escape sequences such as \n, \r and \t are supported |
| Unit | Byte | Byte, Bit |
| Input type | Raw string | Raw string, Hex |