use super::NormalizedLine;
pub fn hash_location_set(locs: &[(usize, usize)]) -> u64 {
let mut hash: u64 = 0xcbf29ce484222325;
for (f, o) in locs {
hash ^= *f as u64;
hash = hash.wrapping_mul(0x100000001b3);
hash ^= *o as u64;
hash = hash.wrapping_mul(0x100000001b3);
}
hash
}
pub fn hash_window(lines: &[NormalizedLine]) -> u64 {
let mut hash: u64 = 0xcbf29ce484222325; for line in lines {
for byte in line.content.as_bytes() {
hash ^= *byte as u64;
hash = hash.wrapping_mul(0x100000001b3); }
hash ^= 0xff;
hash = hash.wrapping_mul(0x100000001b3);
}
hash
}