汉明距离

计算两个等长序列中不同位置的数量,可选择按位或按字节比较。

输入: 文本结果: 文本

文本输入

工具选项

案例

Count three substitutions in the classic string example

Byte distance counts changed positions, not insertions or deletions.

输入

karolin

kathrin

Expected answer

3
分隔符
单位
Byte
输入类型
Raw string
Find a one-bit change in a two-byte packet

FF versus FE changes one bit in the second byte.

输入

00ff|00fe

Expected answer

1
分隔符
|
单位
Bit
输入类型
Hex
Compare every bit in opposite byte values

Two opposite bytes differ in all 16 bit positions.

输入

0000|ffff

Expected answer

16
分隔符
|
单位
Bit
输入类型
Hex
Count changed bytes in two IPv4-style headers

Only the final byte differs; this is a short synthetic header fragment.

输入

45000014|45000028

Expected answer

1
分隔符
|
单位
Byte
输入类型
Hex
Separate byte changes from bit changes in ASCII

ASCII A and a differ by the single 0x20 bit.

输入

A|a

Expected answer

1
分隔符
|
单位
Bit
输入类型
Raw string

参数

参数默认值输入与选项
分隔符"\\n\\n"支持 \n、\r 和 \t 等转义序列
单位字节字节, 位
输入类型Raw 字符串Raw 字符串, 十六进制

相关工具

实用工具

操作参考

查看原始技术文档 (English)