pub fn ion_hash(string: &str) -> Bytes {
    const TQ: u8 = 0x80;
    let representation = string.as_bytes();
    let mut serialized_bytes = vec![B, TQ];
    serialized_bytes.extend_from_slice(&ion_hash_escape(&representation)[..]);
    serialized_bytes.push(E);
    let digest = Sha256::digest(&serialized_bytes);
    BytesMut::from(digest.as_slice()).freeze()
}
/// Returns the Ion hash (using sha256 as the hasher) of the given
/// String.
///
/// At the time of writing, there was no ion-hash implementation. This
/// function aims only to support hashing of Strings with sha256 as
/// that lets us compute the QldbHash (required for the commit digest)
/// of user input in the shell.
///
/// https://amzn.github.io/ion-hash/docs/spec.html
Returns the Ion hash (using sha256 as the hasher) of the given
String.

At the time of writing, there was no ion-hash implementation. This
function aims only to support hashing of Strings with sha256 as
that lets us compute the QldbHash (required for the commit digest)
of user input in the shell.


Returns the Ion hash ( using sha256 as the hasher ) of the given String . At the time of writing there was no ion - hash implementation . This function aims only to support hashing of Strings with sha256 as that lets us compute the QldbHash ( required for the commit digest ) of user input in the shell .
pub fn ion_hash(string: &str) -> Bytes {
    const TQ: u8 = 0x80;
    let representation = string.as_bytes();
    let mut serialized_bytes = vec![B, TQ];
    serialized_bytes.extend_from_slice(&ion_hash_escape(&representation)[..]);
    serialized_bytes.push(E);
    let digest = Sha256::digest(&serialized_bytes);
    BytesMut::from(digest.as_slice()).freeze()
}
pub fn ion_hash ( string : & str ) -> Bytes { const TQ : u8 = 0x80 ; let representation = string . as_bytes ( ) ; let mut serialized_bytes = vec ! [ B TQ ] ; serialized_bytes . extend_from_slice ( & ion_hash_escape ( & representation ) [ .. ] ) ; serialized_bytes . push ( E ) ; let digest = Sha256 :: digest ( & serialized_bytes ) ; BytesMut :: from ( digest . as_slice ( ) ) . freeze ( ) }
Returns the Ion hash (using sha256 as the hasher) of the given
String.
Returns the Ion hash ( using sha256 as the hasher ) of the given String .
string
&str
string
&str