Skip to main content

HashAlgorithm

Trait HashAlgorithm 

Source
pub trait HashAlgorithm {
    const OUTPUT_SIZE: usize;
    const BLOCK_SIZE: usize;
    const ALGORITHM_ID: &'static str;

    // Provided method
    fn name() -> String { ... }
}
Expand description

Marker trait for hash function algorithms

Required Associated Constants§

Source

const OUTPUT_SIZE: usize

Output digest size in bytes

Source

const BLOCK_SIZE: usize

Block size used by the algorithm in bytes

Source

const ALGORITHM_ID: &'static str

Static algorithm identifier for compile-time checking

Provided Methods§

Source

fn name() -> String

Returns the hash algorithm name

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§