Trait tiny_keccak::Hasher

source ·
pub trait Hasher {
    // Required methods
    fn update(&mut self, input: &[u8]);
    fn finalize(self, output: &mut [u8]);
}
Expand description

A trait for hashing an arbitrary stream of bytes.

§Example

let input_a = b"hello world";
let input_b = b"!";
let mut output = [0u8; 32];
hasher.update(input_a);
hasher.update(input_b);
hasher.finalize(&mut output);

Required Methods§

source

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

Absorb additional input. Can be called multiple times.

source

fn finalize(self, output: &mut [u8])

Pad and squeeze the state to the output.

Implementors§