(a: &[u8], b: &[u8])
| 151 | /// shorter length is used and the tail of the longer slice is ignored. |
| 152 | #[inline] |
| 153 | pub fn hamming_distance(a: &[u8], b: &[u8]) -> u32 { |
| 154 | debug_assert_eq!(a.len(), b.len(), "hamming_distance: slice length mismatch"); |
| 155 | let len = a.len().min(b.len()); |
| 156 | let f = DISPATCH.get_or_init(resolve); |
| 157 | f(&a[..len], &b[..len]) |
| 158 | } |
| 159 | |
| 160 | #[cfg(test)] |
| 161 | mod tests { |
no test coverage detected