pub fn common_prefix_length(a: &[u8], b: &[u8]) -> usize
Expand description
Returns the length of the common prefix between the two slices.
ยงExamples
let a = &[0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F];
let b = &[0x0A, 0x0B, 0x0C, 0x0E];
assert_eq!(common_prefix_length(a, b), 3);