pub trait Hasher<T> {
type Digest;
// Required methods
fn new() -> Self;
fn update(&mut self, data: impl AsRef<[T]>);
fn chain_update(self, data: impl AsRef<[T]>) -> Self;
fn finalize(self) -> Self::Digest;
fn finalize_into(self, out: &mut Self::Digest);
fn finalize_reset(&mut self) -> Self::Digest;
fn finalize_into_reset(&mut self, out: &mut Self::Digest);
fn reset(&mut self);
}
Expand description
Trait representing cryptographic hash functions which is generic over the input type.
This interface is largely based on RustCrypto’s Digest trait, except that instead of requiring byte strings as input and byte arrays as output, this is generic over the input values and has a less constrained output digest type.
Required Associated Types§
Required Methods§
fn new() -> Self
fn update(&mut self, data: impl AsRef<[T]>)
fn chain_update(self, data: impl AsRef<[T]>) -> Self
fn finalize(self) -> Self::Digest
fn finalize_into(self, out: &mut Self::Digest)
fn finalize_reset(&mut self) -> Self::Digest
fn finalize_into_reset(&mut self, out: &mut Self::Digest)
fn reset(&mut self)
Object Safety§
This trait is not object safe.