Trait libp2p::multiaddr::multihash::MultihashDigest [−][src]
The MultihashDigest
trait specifies an interface common for all multihash functions.
Required methods
pub fn code(&self) -> T
[src]
The Mutlihash byte value.
pub 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.
pub 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.
pub fn result(self) -> MultihashGeneric<T>
[src]
Retrieve the computed MultihashGeneric
, consuming the hasher.
pub 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.
pub fn reset(&mut self)
[src]
Reset hasher instance to its initial state.