[][src]Trait mundane::hash::Digest

#[must_use]
pub trait Digest: Eq + PartialEq + Display + Debug + Sized + Digest {
    type Bytes;

    const DIGEST_LEN: usize;

#[must_use]
    fn from_bytes(bytes: Self::Bytes) -> Self;
#[must_use] fn bytes(&self) -> Self::Bytes; }

The output of a Hash.

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

Loading content...

Associated Constants

const DIGEST_LEN: usize

The length in bytes of this digest.

Loading content...

Required methods

#[must_use] fn from_bytes(bytes: Self::Bytes) -> Self

Constructs a new digest from bytes.

#[must_use] fn bytes(&self) -> Self::Bytes

Returns the bytes of this digest.

Loading content...

Implementors

impl Digest for Sha256Digest[src]

type Bytes = [u8; 32]

impl Digest for Sha384Digest[src]

type Bytes = [u8; 48]

impl Digest for Sha512Digest[src]

type Bytes = [u8; 64]

impl Digest for InsecureSha1Digest[src]

type Bytes = [u8; 20]

Loading content...