Trait digest::Digest[][src]

pub trait Digest {
    type OutputSize: ArrayLength<u8>;
    fn new() -> Self;
fn update(&mut self, data: impl AsRef<[u8]>);
fn chain_update(self, data: impl AsRef<[u8]>) -> Self;
fn finalize(self) -> Output<Self>;
fn finalize_reset(&mut self) -> Output<Self>;
fn finalize_into(self, out: &mut Output<Self>);
fn finalize_into_reset(&mut self, out: &mut Output<Self>);
fn reset(&mut self);
fn output_size() -> usize;
fn digest(data: impl AsRef<[u8]>) -> Output<Self>; }

The Digest trait specifies an interface common for digest functions.

It's a convenience wrapper around Update, FixedOutput, Reset, Clone, and Default traits. It also provides additional convenience methods.

Associated Types

type OutputSize: ArrayLength<u8>[src]

Output size for Digest

Loading content...

Required methods

fn new() -> Self[src]

Create new hasher instance

fn update(&mut self, data: impl AsRef<[u8]>)[src]

Process data, updating the internal state.

fn chain_update(self, data: impl AsRef<[u8]>) -> Self[src]

Process input data in a chained manner.

fn finalize(self) -> Output<Self>[src]

Retrieve result and consume hasher instance.

fn finalize_reset(&mut self) -> Output<Self>[src]

Retrieve result and reset hasher instance.

fn finalize_into(self, out: &mut Output<Self>)[src]

Write result into provided array and consume the hasher instance.

fn finalize_into_reset(&mut self, out: &mut Output<Self>)[src]

Write result into provided array and reset the hasher instance.

fn reset(&mut self)[src]

Reset hasher instance to its initial state.

fn output_size() -> usize[src]

Get output size of the hasher

fn digest(data: impl AsRef<[u8]>) -> Output<Self>[src]

Compute hash of data.

Loading content...

Implementors

impl<D: FixedOutput> Digest for D[src]

type OutputSize = Self::OutputSize

Loading content...