StatefulHasher

Trait StatefulHasher 

Source
pub trait StatefulHasher<const S: usize>:
    Default
    + Send
    + Sync {
    type Digest: Digest<S>;

    // Required methods
    fn update(&mut self, input: &[u8]);
    fn finalize(&self) -> Self::Digest;
    fn reset(&mut self);
}
Expand description

Trait implemented by a hash function implementation.

Required Associated Types§

Source

type Digest: Digest<S>

The maximum Digest size for that hasher (it is stack allocated). The Digest type to distinguish the output of different Hasher implementations.

Required Methods§

Source

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

Consume input and update internal state.

Source

fn finalize(&self) -> Self::Digest

Returns the final digest.

Source

fn reset(&mut self)

Reset the internal hasher state.

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§