Skip to content

normalizedHammingBatch

normalizedHammingBatch(pairs): (number | null)[]

Compute the normalized Hamming similarity for multiple pairs of strings in a single call.

Returns an array of scores in the same order as the input pairs. Each pair must be an array of exactly two strings [a, b]; otherwise an InvalidArg error is thrown. Returns null for pairs with different lengths.

Parameter Type
pairs readonly (readonly string[])[]

(number | null)[]