Function to_hash_output

Source
pub fn to_hash_output(bytes: &[u8]) -> HashOutput
Expand description

Creates a HashOutput ([u8; 32]) from a possibly incomplete slice.

If the slice is smaller than HashOutput, the remaining bytes are filled with zeros.

ยงExamples

use wnfs_common::utils;

let digest = utils::to_hash_output(&[0xff, 0x22]);

assert_eq!(digest.len(), 32);