Simplify keccak call

This commit is contained in:
dospore
2024-02-26 13:19:45 +10:00
parent 7b58435001
commit b3e46900d9

View File

@@ -16,8 +16,7 @@ use hash_db::Hasher;
use types::Hash256;
pub fn keccak256(bytes: &[u8]) -> Hash256 {
let hash: [u8; 32] = alloy_primitives::utils::keccak256(bytes).into();
Hash256::from(hash)
Hash256::from(alloy_primitives::utils::keccak256(bytes).as_ref())
}
/// Keccak hasher.