[][src]Trait crypto_api::hash::StreamingHash

pub trait StreamingHash {
    fn info(&self) -> HashInfo;
fn init(&mut self) -> Result<(), Box<dyn Error + 'static>>;
fn update(&mut self, input: &[u8]) -> Result<(), Box<dyn Error + 'static>>;
fn finish(
        &mut self,
        buf: &mut [u8]
    ) -> Result<usize, Box<dyn Error + 'static>>; }

A stateful (streaming) hash interface

Required methods

fn info(&self) -> HashInfo

Returns information about the hash

fn init(&mut self) -> Result<(), Box<dyn Error + 'static>>

(Re-)initializes the hash state

fn update(&mut self, input: &[u8]) -> Result<(), Box<dyn Error + 'static>>

Adds the data in input to the hash state

fn finish(&mut self, buf: &mut [u8]) -> Result<usize, Box<dyn Error + 'static>>

Computes the hash into buf and returns the hash length

Loading content...

Implementors

Loading content...