Trait libp2p::multiaddr::multihash::StatefulHasher [−][src]
pub trait StatefulHasher: Default + Send + Sync { type Size: Size; type Digest: Digest<Self::Size>; pub fn update(&mut self, input: &[u8]); pub fn finalize(&self) -> Self::Digest; pub fn reset(&mut self); }
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
pub fn update(&mut self, input: &[u8])
[src]
Consume input and update internal state.
pub fn finalize(&self) -> Self::Digest
[src]
Returns the final digest.
pub fn reset(&mut self)
[src]
Reset the internal hasher state.
Implementors
impl StatefulHasher for Keccak224
[src]
impl StatefulHasher for Keccak224
[src]impl StatefulHasher for Keccak256
[src]
impl StatefulHasher for Keccak256
[src]impl StatefulHasher for Keccak384
[src]
impl StatefulHasher for Keccak384
[src]impl StatefulHasher for Keccak512
[src]
impl StatefulHasher for Keccak512
[src]impl StatefulHasher for Sha2_256
[src]
impl StatefulHasher for Sha2_256
[src]impl StatefulHasher for Sha2_512
[src]
impl StatefulHasher for Sha2_512
[src]impl StatefulHasher for Sha3_224
[src]
impl StatefulHasher for Sha3_224
[src]impl StatefulHasher for Sha3_256
[src]
impl StatefulHasher for Sha3_256
[src]impl StatefulHasher for Sha3_384
[src]
impl StatefulHasher for Sha3_384
[src]impl StatefulHasher for Sha3_512
[src]
impl StatefulHasher for Sha3_512
[src]impl<S> StatefulHasher for Blake2bHasher<S> where
S: Size,
[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
[src]
pub fn reset(&mut self)
[src]
impl<S> StatefulHasher for Blake2sHasher<S> where
S: Size,
[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
[src]
pub fn reset(&mut self)
[src]
impl<S> StatefulHasher for Blake3Hasher<S> where
S: Size,
[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
[src]
pub fn reset(&mut self)
[src]
impl<S> StatefulHasher for IdentityHasher<S> where
S: Size,
[src]
impl<S> StatefulHasher for IdentityHasher<S> where
S: Size,
[src]