summaryrefslogblamecommitdiffstats
path: root/src/hasher.rs
blob: 2aa1033697bd4737be9b591e70cf35c567b6a76e (plain) (tree)
1
                                       
















                                              
/// The hasher used to compare layouts.
pub struct Hasher(twox_hash::XxHash64);

impl Default for Hasher {
    fn default() -> Self {
        Hasher(twox_hash::XxHash64::default())
    }
}

impl core::hash::Hasher for Hasher {
    fn write(&mut self, bytes: &[u8]) {
        self.0.write(bytes)
    }

    fn finish(&self) -> u64 {
        self.0.finish()
    }
}