Trait libipld::cid::multihash::StatefulHasher[][src]

pub trait StatefulHasher: Default + Send + Sync {
    type Size: Size;
    type Digest: Digest<Self::Size>;
    fn update(&mut self, input: &[u8]);
fn finalize(&self) -> Self::Digest;
fn reset(&mut self); }
Expand description

Trait implemented by a hash function implementation.

Associated Types

type Size: Size[src]

The maximum Digest size for that hasher (it is stack allocated).

type Digest: Digest<Self::Size>[src]

The Digest type to distinguish the output of different Hasher implementations.

Required methods

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

Consume input and update internal state.

fn finalize(&self) -> Self::Digest[src]

Returns the final digest.

fn reset(&mut self)[src]

Reset the internal hasher state.

Implementors

impl StatefulHasher for Keccak224[src]

type Size = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>

type Digest = KeccakDigest<<Keccak224 as StatefulHasher>::Size>

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

pub fn finalize(&self) -> <Keccak224 as StatefulHasher>::Digest

Notable traits for Keccak224

impl Write for Keccak224
[src]

pub fn reset(&mut self)[src]

impl StatefulHasher for Keccak256[src]

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>

type Digest = KeccakDigest<<Keccak256 as StatefulHasher>::Size>

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

pub fn finalize(&self) -> <Keccak256 as StatefulHasher>::Digest

Notable traits for Keccak256

impl Write for Keccak256
[src]

pub fn reset(&mut self)[src]

impl StatefulHasher for Keccak384[src]

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B0>

type Digest = KeccakDigest<<Keccak384 as StatefulHasher>::Size>

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

pub fn finalize(&self) -> <Keccak384 as StatefulHasher>::Digest

Notable traits for Keccak384

impl Write for Keccak384
[src]

pub fn reset(&mut self)[src]

impl StatefulHasher for Keccak512[src]

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>

type Digest = KeccakDigest<<Keccak512 as StatefulHasher>::Size>

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

pub fn finalize(&self) -> <Keccak512 as StatefulHasher>::Digest

Notable traits for Keccak512

impl Write for Keccak512
[src]

pub fn reset(&mut self)[src]

impl StatefulHasher for Sha2_256[src]

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>

type Digest = Sha2Digest<<Sha2_256 as StatefulHasher>::Size>

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

pub fn finalize(&self) -> <Sha2_256 as StatefulHasher>::Digest

Notable traits for Sha2_256

impl Write for Sha2_256
[src]

pub fn reset(&mut self)[src]

impl StatefulHasher for Sha2_512[src]

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>

type Digest = Sha2Digest<<Sha2_512 as StatefulHasher>::Size>

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

pub fn finalize(&self) -> <Sha2_512 as StatefulHasher>::Digest

Notable traits for Sha2_512

impl Write for Sha2_512
[src]

pub fn reset(&mut self)[src]

impl StatefulHasher for Sha3_224[src]

type Size = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>

type Digest = Sha3Digest<<Sha3_224 as StatefulHasher>::Size>

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

pub fn finalize(&self) -> <Sha3_224 as StatefulHasher>::Digest

Notable traits for Sha3_224

impl Write for Sha3_224
[src]

pub fn reset(&mut self)[src]

impl StatefulHasher for Sha3_256[src]

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>

type Digest = Sha3Digest<<Sha3_256 as StatefulHasher>::Size>

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

pub fn finalize(&self) -> <Sha3_256 as StatefulHasher>::Digest

Notable traits for Sha3_256

impl Write for Sha3_256
[src]

pub fn reset(&mut self)[src]

impl StatefulHasher for Sha3_384[src]

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B0>

type Digest = Sha3Digest<<Sha3_384 as StatefulHasher>::Size>

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

pub fn finalize(&self) -> <Sha3_384 as StatefulHasher>::Digest

Notable traits for Sha3_384

impl Write for Sha3_384
[src]

pub fn reset(&mut self)[src]

impl StatefulHasher for Sha3_512[src]

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>

type Digest = Sha3Digest<<Sha3_512 as StatefulHasher>::Size>

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

pub fn finalize(&self) -> <Sha3_512 as StatefulHasher>::Digest

Notable traits for Sha3_512

impl Write for Sha3_512
[src]

pub fn reset(&mut self)[src]

impl<S> StatefulHasher for Blake2bHasher<S> where
    S: Size
[src]

type Size = S

type Digest = Blake2bDigest<<Blake2bHasher<S> as StatefulHasher>::Size>

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

pub fn finalize(&self) -> <Blake2bHasher<S> as StatefulHasher>::Digest

Notable traits for Blake2bHasher<S>

impl<S> Write for Blake2bHasher<S> where
    S: Size
[src]

pub fn reset(&mut self)[src]

impl<S> StatefulHasher for Blake2sHasher<S> where
    S: Size
[src]

type Size = S

type Digest = Blake2sDigest<<Blake2sHasher<S> as StatefulHasher>::Size>

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

pub fn finalize(&self) -> <Blake2sHasher<S> as StatefulHasher>::Digest

Notable traits for Blake2sHasher<S>

impl<S> Write for Blake2sHasher<S> where
    S: Size
[src]

pub fn reset(&mut self)[src]

impl<S> StatefulHasher for Blake3Hasher<S> where
    S: Size
[src]

type Size = S

type Digest = Blake3Digest<<Blake3Hasher<S> as StatefulHasher>::Size>

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

pub fn finalize(&self) -> <Blake3Hasher<S> as StatefulHasher>::Digest

Notable traits for Blake3Hasher<S>

impl<S> Write for Blake3Hasher<S> where
    S: Size
[src]

pub fn reset(&mut self)[src]

impl<S> StatefulHasher for IdentityHasher<S> where
    S: Size
[src]

type Size = S

type Digest = IdentityDigest<<IdentityHasher<S> as StatefulHasher>::Size>

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

pub fn finalize(&self) -> <IdentityHasher<S> as StatefulHasher>::Digest

Notable traits for IdentityHasher<S>

impl<S> Write for IdentityHasher<S> where
    S: Size
[src]

pub fn reset(&mut self)[src]