pub trait CryptoHasher: Default + Write {
    // Required methods
    fn seed() -> &'static [u8; 32];
    fn update(&mut self, bytes: &[u8]);
    fn finish(self) -> HashValue;

    // Provided method
    fn hash_all(bytes: &[u8]) -> HashValue { ... }
}
Expand description

A trait for representing the state of a cryptographic hasher.

Required Methods§

source

fn seed() -> &'static [u8; 32]

the seed used to initialize hashing Self before the serialization bytes of the actual value

source

fn update(&mut self, bytes: &[u8])

Write bytes into the hasher.

source

fn finish(self) -> HashValue

Finish constructing the HashValue.

Provided Methods§

source

fn hash_all(bytes: &[u8]) -> HashValue

Convenience method to compute the hash of a complete byte slice.

Implementors§