Skip to main content

HashImpl

Trait HashImpl 

Source
pub trait HashImpl {
    type Context: HashContext;

    // Required method
    fn hasher() -> Self::Context;

    // Provided method
    fn digest(data: impl Writable) -> HashOutput { ... }
}
Expand description

A hash function, selected at the type level.

Required Associated Types§

Source

type Context: HashContext

The incremental hashing state for this function.

Required Methods§

Source

fn hasher() -> Self::Context

Starts a new hash computation.

Provided Methods§

Source

fn digest(data: impl Writable) -> HashOutput

Hashes the bytes written by data.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§