function hamming(
a: Uint8Array | BinaryArray | TensorBase,
b: Uint8Array | BinaryArray | TensorBase,
): number Both vectors are treated as bit-packed, u1 dtype, where each byte holds 8 bits.
Use toBinary to convert numeric arrays to bit-packed format.
Parameters
aUint8Array | BinaryArray | TensorBase | The first bit-packed vector, as Uint8Array, BinaryArray, or TensorBase. | |
|---|---|---|
bUint8Array | BinaryArray | TensorBase | The second bit-packed vector, matching the length of a. |
Returns
a and b.