Trait libp2p::core::multiaddr::multihash::MultihashDigest [−][src]
Trait that implements hashing.
It is usually implemented by a custom code table enum that derives the Multihash
derive.
Associated Types
Loading content...Required methods
pub fn digest(&self, input: &[u8]) -> Multihash<Self::AllocSize>
[src]
Calculate the hash of some input data.
Example
// `Code` implements `MultihashDigest` use multihash::{Code, MultihashDigest}; let hash = Code::Sha3_256.digest(b"Hello world!"); println!("{:02x?}", hash);
pub fn multihash_from_digest<'a, S, D>(
digest: &'a D
) -> Multihash<Self::AllocSize> where
Self: From<&'a D>,
S: Size,
D: Digest<S>,
[src]
digest: &'a D
) -> Multihash<Self::AllocSize> where
Self: From<&'a D>,
S: Size,
D: Digest<S>,
Implementors
impl MultihashDigest for Code
[src]
type AllocSize = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>
pub fn digest(
&self,
input: &[u8]
) -> Multihash<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>
[src]
&self,
input: &[u8]
) -> Multihash<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>
pub fn multihash_from_digest<'a, S, D>(
digest: &'a D
) -> Multihash<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>> where
S: Size,
D: Digest<S>,
Code: From<&'a D>,
[src]
digest: &'a D
) -> Multihash<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>> where
S: Size,
D: Digest<S>,
Code: From<&'a D>,