mundane::hash

Trait 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 Constants§

Source

const DIGEST_LEN: usize

The length in bytes of this digest.

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 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§