Add tests for hash inversion #185

Merged
lucas merged 1 commit from feat/murmur-tests into master 2024-08-14 14:07:31 +02:00

View file

@ -119,4 +119,9 @@ fn test_hash() {
}
#[test]
fn test_inverse() {}
fn test_inverse() {
let h = hash("lua".as_bytes(), crate::murmur::SEED as u64);
let inv = hash_inverse(h, crate::murmur::SEED as u64);
assert_eq!(h, hash(&inv.to_le_bytes(), crate::murmur::SEED as u64));
assert_ne!(h, hash(&inv.to_be_bytes(), crate::murmur::SEED as u64));
}