pub trait HashFunction {
const OUTPUT_SIZE: usize;
// Required method
fn hash_to(data: &[u8], output: &mut [u8]);
// Provided method
fn hash(data: &[u8]) -> Vec<u8> ⓘ { ... }
}Expand description
Hash algorithm trait providing a unified interface for different hash algorithms
Required Associated Constants§
Sourceconst OUTPUT_SIZE: usize
const OUTPUT_SIZE: usize
Hash output size (in bytes)
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.