[][src]Trait tiny_keccak::Hasher

pub trait Hasher {
    fn update(&mut self, input: &[u8]);
fn finalize(self, output: &mut [u8]); }

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

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

Absorb additional input. Can be called multiple times.

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

Pad and squeeze the state to the output.

Loading content...

Implementors

impl Hasher for CShake[src]

impl Hasher for Keccak[src]

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

Absorb additional input. Can be called multiple times.

Example

keccak.update(b"hello");
keccak.update(b" world");

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

Pad and squeeze the state to the output.

Example

keccak.finalize(&mut output);

impl Hasher for Kmac[src]

impl Hasher for ParallelHash[src]

impl Hasher for Sha3[src]

impl Hasher for Shake[src]

impl Hasher for TupleHash[src]

impl<T: AsRef<[u8]>> Hasher for KangarooTwelve<T>[src]

Loading content...