// Copyright 2021-2022 Parity Technologies (UK) Ltd.
// This file is dual-licensed as Apache-2.0 or MIT.
use std::hash::BuildHasherDefault;
#[derive(Default)]
pub struct IdentityKeyHash(u64);
pub type IdentityBuildHasher = BuildHasherDefault<IdentityKeyHash>;
impl std::hash::Hasher for IdentityKeyHash {
fn finish(&self) -> u64 {
self.0
}
fn write(&mut self, bytes: &[u8]) {
self.0 = u64::from_le_bytes((&bytes[0..8]).try_into().unwrap())
}
}