pub fn wrap(code: u64, input_digest: &[u8]) -> Result<Self, Error> {
    if input_digest.len() > S {
      return Err(Error::InvalidSize(input_digest.len() as _));
    }
    let size = input_digest.len();
    let mut digest = [0; S];
    digest[..size].copy_from_slice(input_digest);
    Ok(Self { code, size: size as u8, digest })
  }
/// Wraps the digest in a multihash.
Wraps the digest in a multihash.
Wraps the digest in a multihash .
pub fn wrap(code: u64, input_digest: &[u8]) -> Result<Self, Error> {
    if input_digest.len() > S {
      return Err(Error::InvalidSize(input_digest.len() as _));
    }
    let size = input_digest.len();
    let mut digest = [0; S];
    digest[..size].copy_from_slice(input_digest);
    Ok(Self { code, size: size as u8, digest })
  }
pub fn wrap ( code : u64 , input_digest : & [ u8 ] ) -> Result < Self , Error > { if input_digest . len ( ) > S { return Err ( Error :: InvalidSize ( input_digest . len ( ) as _ ) ) ; } let size = input_digest . len ( ) ; let mut digest = [ 0 ; S ] ; digest [ .. size ] . copy_from_slice ( input_digest ) ; Ok ( Self { code , size : size as u8 , digest } ) }
Wraps the digest in a multihash.
Wraps the digest in a multihash .
code
u64
input_digest
&[u8]
code
u64
input_digest
&[u8]