Trait multihash::MultihashDigest[][src]

pub trait MultihashDigest<T: TryFrom<u64>> {
    fn code(&self) -> T;
fn digest(&self, data: &[u8]) -> MultihashGeneric<T>;
fn input(&mut self, data: &[u8]);
fn result(self) -> MultihashGeneric<T>;
fn result_reset(&mut self) -> MultihashGeneric<T>;
fn reset(&mut self); }

The MultihashDigest trait specifies an interface common for all multihash functions.

Required methods

fn code(&self) -> T[src]

The Mutlihash byte value.

fn digest(&self, data: &[u8]) -> MultihashGeneric<T>[src]

Hash some input and return the digest.

Panics

Panics if the digest length is bigger than 2^32. This only happens for identity hasing.

fn input(&mut self, data: &[u8])[src]

Digest data, updating the internal state.

This method can be called repeatedly for use with streaming messages.

Panics

Panics if the digest length is bigger than 2^32. This only happens for identity hashing.

fn result(self) -> MultihashGeneric<T>[src]

Retrieve the computed MultihashGeneric, consuming the hasher.

fn result_reset(&mut self) -> MultihashGeneric<T>[src]

Retrieve result and reset hasher instance.

This method sometimes can be more efficient compared to hasher re-creation.

fn reset(&mut self)[src]

Reset hasher instance to its initial state.

Loading content...

Implementors

impl MultihashDigest<Code> for Blake2b256[src]

impl MultihashDigest<Code> for Blake2b512[src]

impl MultihashDigest<Code> for Blake2s128[src]

impl MultihashDigest<Code> for Blake2s256[src]

impl MultihashDigest<Code> for Identity[src]

impl MultihashDigest<Code> for Keccak224[src]

impl MultihashDigest<Code> for Keccak256[src]

impl MultihashDigest<Code> for Keccak384[src]

impl MultihashDigest<Code> for Keccak512[src]

impl MultihashDigest<Code> for Sha1[src]

impl MultihashDigest<Code> for Sha2_256[src]

impl MultihashDigest<Code> for Sha2_512[src]

impl MultihashDigest<Code> for Sha3_224[src]

impl MultihashDigest<Code> for Sha3_256[src]

impl MultihashDigest<Code> for Sha3_384[src]

impl MultihashDigest<Code> for Sha3_512[src]

Loading content...