Skip to main content

Digest

Trait Digest 

Source
pub trait Digest {
    // Required methods
    fn update(&mut self, data: &[u8]);
    fn finalize(self) -> Vec<u8> ;
}
Expand description

Defines the streaming digest contract used by hash implementations.

Required Methods§

Source

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

Feeds additional bytes into the digest state.

§Arguments
  • data: Additional message bytes to absorb into the hash state.
§Panics

This function does not panic for conforming implementations in this crate.

Source

fn finalize(self) -> Vec<u8>

Finalizes the digest and returns the resulting hash bytes.

§Returns

Final digest bytes for all input provided through update.

§Panics

This function does not panic for conforming implementations in this crate.

Implementors§