Trait digest::Digest [−][src]
pub trait Digest { type OutputSize: ArrayLength<u8>; fn new() -> Self; fn update(&mut self, data: impl AsRef<[u8]>); fn chain(self, data: impl AsRef<[u8]>) -> Self
where
Self: Sized; fn finalize(self) -> Output<Self>; fn finalize_reset(&mut self) -> Output<Self>; fn reset(&mut self); fn output_size() -> usize; fn digest(data: &[u8]) -> Output<Self>; }
Expand description
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]
type OutputSize: ArrayLength<u8>
[src]Output size for Digest
Required methods
Digest data, updating the internal state.
This method can be called repeatedly for use with streaming messages.
Digest input data in a chained manner.
fn finalize_reset(&mut self) -> Output<Self>
[src]
fn finalize_reset(&mut self) -> Output<Self>
[src]Retrieve result and reset hasher instance.
This method sometimes can be more efficient compared to hasher re-creation.
fn output_size() -> usize
[src]
fn output_size() -> usize
[src]Get output size of the hasher