Commit c2f81d05 authored by Philip Woolford's avatar Philip Woolford
Browse files

Oops: looks like chunking changes hash

parent 8f0cfcf9
......@@ -120,3 +120,25 @@ impl Hasher for SeaHasher {
self.write(n as u64, !k3, !k2)
}
}
#[cfg(test)]
mod tests {
use super::*;
use crate::reference::hash as reference_hash;
use core::hash::Hasher;
#[test]
fn reference_equiv() {
let test_buf: &[u8] = &[0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0, 0, 0, 0, 0, 0, 0];
let mut stream_hasher1 = SeaHasher::default();
Hasher::write(&mut stream_hasher1, test_buf);
let mut stream_hasher2 = SeaHasher::default();
Hasher::write(&mut stream_hasher2, &test_buf[..8]);
Hasher::write(&mut stream_hasher2, &test_buf[8..]);
assert_eq!(stream_hasher1.finish(), stream_hasher2.finish())
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment