pub trait Hasher {
const OUTPUT_LEN: usize;
const BLOCK_LEN: usize;
// Required methods
fn new() -> Self;
fn update(&mut self, data: &[u8]);
fn finalize(self) -> Vec<u8> ⓘ;
fn finalize_into(self, out: &mut [u8]);
// Provided method
fn hash(data: &[u8]) -> Vec<u8> ⓘ
where Self: Sized { ... }
}Expand description
Trait for hash functions (fixed-output).
Required Associated Constants§
Sourceconst OUTPUT_LEN: usize
const OUTPUT_LEN: usize
Output size in bytes.
Required Methods§
Sourcefn finalize_into(self, out: &mut [u8])
fn finalize_into(self, out: &mut [u8])
Finalize into a caller-provided buffer (no allocation).
Provided Methods§
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.