Trait tetsy_libp2p::core::multiaddr::multihash::StatefulHasher [−]
Trait implemented by a hash function implementation.
Associated Types
type Size: Size
The maximum Digest size for that hasher (it is stack allocated).
type Digest: Digest<Self::Size>
The Digest type to distinguish the output of different Hasher
implementations.
Required methods
pub fn update(&mut self, input: &[u8])
Consume input and update internal state.
pub fn finalize(&self) -> Self::Digest
Returns the final digest.
pub fn reset(&mut self)
Reset the internal hasher state.
Implementors
impl StatefulHasher for Sha2_256
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])
pub fn finalize(&self) -> <Sha2_256 as StatefulHasher>::Digest
pub fn reset(&mut self)
impl StatefulHasher for Sha2_512
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])
pub fn finalize(&self) -> <Sha2_512 as StatefulHasher>::Digest
pub fn reset(&mut self)
impl<S> StatefulHasher for IdentityHasher<S> where
S: Size,
S: Size,