Trait mundane::hash::Digest

source ·
pub trait Digest: Eq + PartialEq + Display + Debug + Sized + Digest {
    type Bytes;

    const DIGEST_LEN: usize;

    // Required methods
    fn from_bytes(bytes: Self::Bytes) -> Self;
    fn bytes(&self) -> Self::Bytes;
Expand description

The output of a Hash.

Required Associated Types§


type Bytes

The byte array equivalent of this digest.

Bytes is guaranteed to be [u8; DIGEST_LEN]. Once const generics are supported, this type will be removed and replaced with [u8; DIGEST_LEN].

Required Associated Constants§


const DIGEST_LEN: usize

The length in bytes of this digest.

Required Methods§


fn from_bytes(bytes: Self::Bytes) -> Self

Constructs a new digest from bytes.


fn bytes(&self) -> Self::Bytes

Returns the bytes of this digest.

Object Safety§

This trait is not object safe.