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§

source

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§

source

const DIGEST_LEN: usize

The length in bytes of this digest.

Required Methods§

source

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

Constructs a new digest from bytes.

source

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

Returns the bytes of this digest.

Object Safety§

This trait is not object safe.

Implementors§