pub trait SimpleHasher: Sized {
// Required methods
fn new() -> Self;
fn update(&mut self, data: &[u8]);
fn finalize(self) -> [u8; 32];
// Provided method
fn hash(data: impl AsRef<[u8]>) -> [u8; 32] { ... }
}
Expand description
A minimal trait representing a hash function. We implement our own
rather than relying on Digest
for broader compatibility.
Required Methods§
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.