Skip to main content

Hash

Trait Hash 

Source
pub trait Hash {
    type Output;

    // Required methods
    fn new() -> Self;
    fn update(&mut self, data: &[u8]);
    fn finalize(self) -> Self::Output;
}
Expand description

A streaming hash function.

Required Associated Types§

Source

type Output

The fixed-size digest output.

Required Methods§

Source

fn new() -> Self

Construct a fresh hasher.

Source

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

Absorb input bytes.

Source

fn finalize(self) -> Self::Output

Consume the hasher and produce the final digest.

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 Hash for Sm3

Source§

type Output = [u8; 32]