pub trait HashDigest<const BLOCK_SIZE: usize, const OUTPUT_SIZE: usize>: Default {
// Required methods
fn write(&mut self, bytes: &[u8]);
fn hash(self, bytes: &[u8]) -> [u8; OUTPUT_SIZE];
fn finish(self) -> [u8; OUTPUT_SIZE];
fn algorithm() -> HashAlgorithm;
}Expand description
Generic trait to describe a hash function
Required Methods§
fn write(&mut self, bytes: &[u8])
fn hash(self, bytes: &[u8]) -> [u8; OUTPUT_SIZE]
fn finish(self) -> [u8; OUTPUT_SIZE]
fn algorithm() -> HashAlgorithm
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.