pub trait HashAlgorithm {
const OUTPUT_SIZE: usize;
const BLOCK_SIZE: usize;
const ALGORITHM_ID: &'static str;
// Provided method
fn name() -> String { ... }
}Expand description
Marker trait for hash algorithms with compile-time guarantees
Required Associated Constants§
Sourceconst OUTPUT_SIZE: usize
const OUTPUT_SIZE: usize
Output size in bytes
Sourceconst BLOCK_SIZE: usize
const BLOCK_SIZE: usize
Block size in bytes
Sourceconst ALGORITHM_ID: &'static str
const ALGORITHM_ID: &'static str
Static algorithm identifier for compile-time checking
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.
Implementors§
Source§impl HashAlgorithm for Blake2bAlgorithm
impl HashAlgorithm for Blake2bAlgorithm
const OUTPUT_SIZE: usize = BLAKE2B_MAX_OUTPUT_SIZE
const BLOCK_SIZE: usize = BLAKE2B_BLOCK_SIZE
const ALGORITHM_ID: &'static str = "BLAKE2b"
Source§impl HashAlgorithm for Blake2sAlgorithm
Implement HashAlgorithm for Blake2s
impl HashAlgorithm for Blake2sAlgorithm
Implement HashAlgorithm for Blake2s