2019-07-20 19:12:31 +02:00
|
|
|
/// The hasher used to compare layouts.
|
2022-07-04 01:17:29 +02:00
|
|
|
#[derive(Debug, Default)]
|
2019-08-30 01:54:41 +02:00
|
|
|
pub struct Hasher(twox_hash::XxHash64);
|
|
|
|
|
|
|
|
|
|
impl core::hash::Hasher for Hasher {
|
|
|
|
|
fn write(&mut self, bytes: &[u8]) {
|
|
|
|
|
self.0.write(bytes)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn finish(&self) -> u64 {
|
|
|
|
|
self.0.finish()
|
|
|
|
|
}
|
|
|
|
|
}
|