Hasher

Trait Hasher 

Source
pub trait Hasher {
    const ID: u8;

    // Required methods
    fn hash(val: &[u8]) -> Result<Hash, HasherError>;
    fn hashv(vals: &[&[u8]]) -> Result<Hash, HasherError>;
    fn zero_bytes() -> ZeroBytes;
    fn zero_indexed_leaf() -> [u8; 32];
}

Required Associated Constants§

Source

const ID: u8

Required Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Hasher for Keccak

Source§

const ID: u8 = 2u8

Source§

impl Hasher for Poseidon

Source§

const ID: u8 = 0u8

Source§

impl Hasher for Sha256

Source§

const ID: u8 = 1u8

Source§

impl Hasher for Sha256BE

Source§

const ID: u8 = 3u8