Skip to main content

StreamingHash

Trait StreamingHash 

Source
pub trait StreamingHash: Send {
    // Required methods
    fn update(&mut self, data: &[u8]);
    fn finalize(self, out: &mut [u8]) -> Result<(), CryptoError>;
    fn reset(&mut self);
}
Expand description

Incremental (streaming) hash computation.

Feed data in chunks with update, then call finalize to obtain the digest.

Required Methods§

Source

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

Feed additional data into the hash state.

Source

fn finalize(self, out: &mut [u8]) -> Result<(), CryptoError>

Consume the hasher and write the final digest into out.

Returns CryptoError::BufferTooSmall if out is too short.

Source

fn reset(&mut self)

Reset the hasher to its initial state, allowing reuse.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§