[][src]Trait mundane::hash::Hasher

pub trait Hasher: Default + Hasher {
    type Digest: Digest;
    fn update(&mut self, bytes: &[u8]);
#[must_use] fn finish(self) -> Self::Digest; #[must_use] fn hash(bytes: &[u8]) -> Self::Digest { ... } }

A cryptographic hash function.

Associated Types

type Digest: Digest

The output digest.

Loading content...

Required methods

fn update(&mut self, bytes: &[u8])

Adds bytes to the hash.

#[must_use] fn finish(self) -> Self::Digest

Returns the digest of the bytes added so far.

Loading content...

Provided methods

#[must_use] fn hash(bytes: &[u8]) -> Self::Digest

Computes the hash of a sequence of bytes.

hash creates a new instance of this hash function, adds bytes to it, and then computes the digest.

Loading content...


impl Hasher for Sha256[src]

type Digest = Sha256Digest

impl Hasher for Sha384[src]

type Digest = Sha384Digest

impl Hasher for Sha512[src]

type Digest = Sha512Digest

Loading content...