pub trait HashFunction<const DIGEST_LENGTH: usize>: Default {
const OUTPUT_SIZE: usize = DIGEST_LENGTH;
// Required methods
fn update<Data: AsRef<[u8]>>(&mut self, data: Data);
fn finalize(self) -> Digest<DIGEST_LENGTH>;
// Provided methods
fn new() -> Self { ... }
fn digest<Data: AsRef<[u8]>>(data: Data) -> Digest<DIGEST_LENGTH> { ... }
fn digest_iterator<K: AsRef<[u8]>, I: Iterator<Item = K>>(
iter: I,
) -> Digest<DIGEST_LENGTH> { ... }
}Expand description
Trait implemented by hash functions providing a output of fixed length
Provided Associated Constants§
Sourceconst OUTPUT_SIZE: usize = DIGEST_LENGTH
const OUTPUT_SIZE: usize = DIGEST_LENGTH
The length of this hash functions digests 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.