ckb_fixed_hash_core/
std_hash.rs

1use crate::{H160, H256, H512, H520};
2
3macro_rules! impl_std_hash_hash {
4    ($name:ident, $bytes_size:expr) => {
5        impl ::std::hash::Hash for $name {
6            #[inline]
7            fn hash<H: ::std::hash::Hasher>(&self, state: &mut H) {
8                state.write(&self.0[..])
9            }
10        }
11    };
12}
13
14impl_std_hash_hash!(H160, 20);
15impl_std_hash_hash!(H256, 32);
16impl_std_hash_hash!(H512, 64);
17impl_std_hash_hash!(H520, 65);