Distanza di Hamming

Conta posizioni diverse tra sequenze di uguale lunghezza, per bit o byte.

Input: TestoRisultato: Testo

Inserimento di testo

Opzioni

Esempi

Count three substitutions in the classic string example

Byte distance counts changed positions, not insertions or deletions.

Input

karolin

kathrin

Expected answer

3
Delimitatore
Unità
Byte
Tipo di input
Raw string
Find a one-bit change in a two-byte packet

FF versus FE changes one bit in the second byte.

Input

00ff|00fe

Expected answer

1
Delimitatore
|
Unità
Bit
Tipo di input
Hex
Compare every bit in opposite byte values

Two opposite bytes differ in all 16 bit positions.

Input

0000|ffff

Expected answer

16
Delimitatore
|
Unità
Bit
Tipo di input
Hex
Count changed bytes in two IPv4-style headers

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

Input

45000014|45000028

Expected answer

1
Delimitatore
|
Unità
Byte
Tipo di input
Hex
Separate byte changes from bit changes in ASCII

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

Input

A|a

Expected answer

1
Delimitatore
|
Unità
Bit
Tipo di input
Raw string

Parametri

ParametroValore predefinitoInput e opzioni
Delimitatore"\\n\\n"Sono supportate sequenze di escape come \n, \r e \t
UnitàByteByte, Bit
Tipo di inputStringa grezzaStringa grezza, Esadecimale

Strumenti correlati

Utilità

Riferimento dell’operazione

Vedi la documentazione tecnica originale (English)