Skip to main content

FingerprintHasher

Trait FingerprintHasher 

Source
pub trait FingerprintHasher {
    type Error;

    // Required methods
    fn algorithm(&self) -> DigestAlgorithm;
    fn digest(
        &self,
        input: &[u8],
        output: &mut [u8],
    ) -> Result<usize, Self::Error>;
}
Expand description

Caller-provided collision-resistant fingerprint digest implementation.

Implementations must compute the declared algorithm over exactly input. Ordinary Hash, CRC, and other non-cryptographic digests do not satisfy this security contract.

Required Associated Types§

Source

type Error

Hashing failure.

Required Methods§

Source

fn algorithm(&self) -> DigestAlgorithm

Returns the collision-resistant algorithm implemented by this value.

Source

fn digest(&self, input: &[u8], output: &mut [u8]) -> Result<usize, Self::Error>

Writes the digest and returns its initialized length.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§