pub trait HashAlgoKernel {
type Option: HashOption;
type Error: Into<HashError> + Debug;
type Output: Eq + AsRef<[u8]> + LowerHex + UpperHex;
// Required methods
fn name() -> &'static str;
fn digest_size() -> usize;
fn new(opt: Self::Option) -> Self;
fn update<T>(&mut self, data: T) -> Result<(), Self::Error>
where T: AsRef<[u8]>;
fn finalize(self) -> Result<Self::Output, Self::Error>;
}Expand description
Kernel of hash algorithms.
Required Associated Types§
Required Methods§
Sourcefn digest_size() -> usize
fn digest_size() -> usize
The size of the output in bytes.
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.