[][src]Function md6::hash

pub fn hash(hashbitlen: i32, data: &[u8], hashval: &mut [u8]) -> Result<()>

Hash all data in one fell swoop.

Refer to individual functions for extended documentation.

Example

let mut result_256 = [0; 32];
let mut result_512 = [0; 64];

md6::hash(256, &[], &mut result_256).unwrap();
md6::hash(512, &[], &mut result_512).unwrap();

assert_eq!(Vec::from_iter(result_256.iter().map(|&i| i)),
           vec![0xBC, 0xA3, 0x8B, 0x24, 0xA8, 0x04, 0xAA, 0x37,
                0xD8, 0x21, 0xD3, 0x1A, 0xF0, 0x0F, 0x55, 0x98,
                0x23, 0x01, 0x22, 0xC5, 0xBB, 0xFC, 0x4C, 0x4A,
                0xD5, 0xED, 0x40, 0xE4, 0x25, 0x8F, 0x04, 0xCA]);
assert_eq!(Vec::from_iter(result_512.iter().map(|&i| i)),
           vec![0x6B, 0x7F, 0x33, 0x82, 0x1A, 0x2C, 0x06, 0x0E,
                0xCD, 0xD8, 0x1A, 0xEF, 0xDD, 0xEA, 0x2F, 0xD3,
                0xC4, 0x72, 0x02, 0x70, 0xE1, 0x86, 0x54, 0xF4,
                0xCB, 0x08, 0xEC, 0xE4, 0x9C, 0xCB, 0x46, 0x9F,
                0x8B, 0xEE, 0xEE, 0x7C, 0x83, 0x12, 0x06, 0xBD,
                0x57, 0x7F, 0x9F, 0x26, 0x30, 0xD9, 0x17, 0x79,
                0x79, 0x20, 0x3A, 0x94, 0x89, 0xE4, 0x7E, 0x04,
                0xDF, 0x4E, 0x6D, 0xEA, 0xA0, 0xF8, 0xE0, 0xC0]);