Skip to main content

hamming_distance

Function hamming_distance 

Source
pub fn hamming_distance(a: &[u8], b: &[u8]) -> u32
Expand description

Count the number of differing bits between two equal-length packed-bit slices, dispatching to the best available SIMD kernel at runtime.

In debug builds, panics if a.len() != b.len(). In release builds, the shorter length is used and the tail of the longer slice is ignored.