(content: &[u8])
| 274 | /// - Simplicity: Easy to implement and understand |
| 275 | #[inline] |
| 276 | fn compute_hash(content: &[u8]) -> u64 { |
| 277 | // FNV-1a parameters for 64-bit |
| 278 | const FNV_OFFSET_BASIS: u64 = 0xcbf29ce484222325; |
| 279 | const FNV_PRIME: u64 = 0x100000001b3; |
| 280 | |
| 281 | let mut hash = FNV_OFFSET_BASIS; |
| 282 | for &byte in content { |
| 283 | hash ^= byte as u64; |
| 284 | hash = hash.wrapping_mul(FNV_PRIME); |
| 285 | } |
| 286 | hash |
| 287 | } |
| 288 | |
| 289 | /// Compare two lines for equality, optionally ignoring trailing newline differences. |
| 290 | /// |
nothing calls this directly
no outgoing calls
no test coverage detected