pub trait Hasher: 'static {
type Config: Send + Sync + 'static;
type Error: Error + Send + Sync + 'static;
// Required methods
fn hash(
data: impl AsRef<[u8]>,
config: &Self::Config,
) -> Result<String, Self::Error>;
fn verify(data: impl AsRef<[u8]>, hash: &str) -> Result<bool, Self::Error>;
}
Expand description
Implement this to use your own hashing algorithm with this library
Required Associated Types§
Required 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.