pub mod blake2 {
use crate::hash::H256;
use hash256_std_hasher::Hash256StdHasher;
use hash_db::Hasher;
#[derive(Debug)]
pub struct Blake2Hasher;
impl Hasher for Blake2Hasher {
type Out = H256;
type StdHasher = Hash256StdHasher;
const LENGTH: usize = 32;
fn hash(x: &[u8]) -> Self::Out {
crate::hashing::blake2_256(x).into()
}
}
}
pub mod keccak {
use crate::hash::H256;
use hash256_std_hasher::Hash256StdHasher;
use hash_db::Hasher;
#[derive(Debug)]
pub struct KeccakHasher;
impl Hasher for KeccakHasher {
type Out = H256;
type StdHasher = Hash256StdHasher;
const LENGTH: usize = 32;
fn hash(x: &[u8]) -> Self::Out {
crate::hashing::keccak_256(x).into()
}
}
}