1 2 3 4 5 6 7 8 9 10 11 12
pub fn fnv1a(bytes: &[u8]) -> u64 { let mut hash = 0xcbf29ce484222325; for &b in bytes { hash ^= b as u64; hash = hash.wrapping_mul(0x100000001b3); } hash } pub fn cat(s: &str) -> i64 { fnv1a(s.as_bytes()) as i64 }