Trait Digest

trait Digest: OutputSizeUser

Convenience wrapper trait covering functionality of cryptographic hash functions with fixed output size.

This trait wraps Update, FixedOutput, Default, and HashMarker traits and provides additional convenience methods.

Required Methods

fn new() -> Self

Create new hasher instance.

fn new_with_prefix<impl AsRef<[u8]>: AsRef<[u8]>>(data: impl AsRef<[u8]>) -> Self

Create new hasher instance which has processed the provided data.

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

Process data, updating the internal state.

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

Process input data in a chained manner.

fn finalize(self: Self) -> Output<Self>

Retrieve result and consume hasher instance.

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

Write result into provided array and consume the hasher instance.

fn finalize_reset(self: &mut Self) -> Output<Self>
where
    Self: FixedOutputReset

Retrieve result and reset hasher instance.

fn finalize_into_reset(self: &mut Self, out: &mut Output<Self>)
where
    Self: FixedOutputReset

Write result into provided array and reset the hasher instance.

fn reset(self: &mut Self)
where
    Self: Reset

Reset hasher instance to its initial state.

fn output_size() -> usize

Get output size of the hasher

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

Compute hash of data.

Implementors