pub trait Hasher: Clone + Zeroize {
const BLOCK_SIZE: usize;
const OUTPUT_SIZE: usize;
// Required methods
fn new() -> Self;
fn update(&mut self, data: &[u8]);
fn sum(self) -> Hash;
// Provided method
fn hash(data: &[u8]) -> Hash { ... }
}Expand description
Zeroize is a no-op when the zeroize feature is not enabled.
Required Associated Constants§
Sourceconst BLOCK_SIZE: usize
const BLOCK_SIZE: usize
The internal block size of the hash function
Sourceconst OUTPUT_SIZE: usize
const OUTPUT_SIZE: usize
The output size of the hash function.
Must not exceed MAX_HASH_OUTPUT_SIZE (64), the fixed capacity of
[Hash]; implementors with a larger OUTPUT_SIZE will not compile when
used with functions that bound-check against this limit.
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".