Skip to main content

HashDigestAlgorithm

Trait HashDigestAlgorithm 

Source
pub trait HashDigestAlgorithm {
    const ALG: HashAlgorithm;

    // Required method
    fn digest(message: &[u8]) -> Result<Vec<u8>, AlgorithmError>;
}
Expand description

Adapter contract for a cryptographic hash algorithm.

Required Associated Constants§

Source

const ALG: HashAlgorithm

The hash algorithm selector this adapter implements.

Required Methods§

Source

fn digest(message: &[u8]) -> Result<Vec<u8>, AlgorithmError>

Compute the digest of message, returning the raw digest bytes.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§