pub trait MultihashDigest<const S: usize>: TryFrom<u64, Error = UnsupportedCode> + Into<u64> + Send + Sync + Unpin + Copy + Eq + Debug + 'static {
    // Required methods
    fn digest(&self, input: &[u8]) -> Multihash<S>;
    fn wrap(&self, digest: &[u8]) -> Result<Multihash<S>, Error>;
}
Expand description

Trait that implements hashing.

Typically, you won’t implement this yourself but use the MultihashDigest custom-derive.

Required Methods§

source

fn digest(&self, input: &[u8]) -> Multihash<S>

Calculate the hash of some input data.

source

fn wrap(&self, digest: &[u8]) -> Result<Multihash<S>, Error>

Create a multihash from an existing multihash digest.

Implementors§