Assumes x and y have same memory alignment
Uses highly optimized avx2 version if available
fallback on distance_faster if x
and y
have different alignment or if avx2 features are not available
x
- a byte slice (prefer 32 byte alignment to get highest performance)y
- sameuse hamming_rs::distance;
let x: [u8;5] = [0, 1, 2, 3, 4];
let y: [u8;5] = [0, 1, 3, 2, 4];
let dist = distance(&x, &y);
assert_eq!(2, dist);