Skip to main content

Hasher

Trait Hasher 

Source
pub trait Hasher:
    Sized
    + Clone
    + Zeroize {
    const BLOCK_SIZE: usize;
    const OUTPUT_SIZE: usize;

    // Required methods
    fn new() -> Self;
    fn update(&mut self, data: &[u8]);
    fn sum(self) -> Hash;

    // Provided method
    fn hash(data: &[u8]) -> Hash { ... }
}

Required Associated Constants§

Source

const BLOCK_SIZE: usize

The internal block size of the hash function

Source

const OUTPUT_SIZE: usize

The output size of the hash function

Required Methods§

Source

fn new() -> Self

Source

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

Source

fn sum(self) -> Hash

Provided Methods§

Source

fn hash(data: &[u8]) -> Hash

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§