(bytes: &[u8])
| 24 | /// need to compute and compare hashes outside the index abstraction. |
| 25 | #[inline] |
| 26 | pub fn hash_line(bytes: &[u8]) -> u64 { |
| 27 | const FNV_OFFSET: u64 = 0xcbf2_9ce4_8422_2325; |
| 28 | const FNV_PRIME: u64 = 0x0000_0100_0000_01b3; |
| 29 | let mut h = FNV_OFFSET; |
| 30 | for &b in bytes { |
| 31 | h ^= b as u64; |
| 32 | h = h.wrapping_mul(FNV_PRIME); |
| 33 | } |
| 34 | h |
| 35 | } |
| 36 | |
| 37 | /// Index of line content → positions where that content appears. |
| 38 | /// |
no outgoing calls
no test coverage detected