iced-yoda/core/src/hasher.rs

15 lines
391 B
Rust
Raw Normal View History

2019-07-20 19:12:31 +02:00
/// The hasher used to compare layouts.
#[allow(missing_debug_implementations)] // Doesn't really make sense to have debug on the hasher state anyways.
#[derive(Default)]
pub struct Hasher(xxhash_rust::xxh3::Xxh3);
2019-08-30 01:54:41 +02:00
impl core::hash::Hasher for Hasher {
fn write(&mut self, bytes: &[u8]) {
self.0.write(bytes);
2019-08-30 01:54:41 +02:00
}
fn finish(&self) -> u64 {
self.0.finish()
}
}