sha3/sha3.rs
1use tiny_keccak::{Hasher, Sha3};
2
3fn main() {
4 let mut sha3 = Sha3::v256();
5 let mut output = [0; 32];
6 let expected = b"\
7 \x64\x4b\xcc\x7e\x56\x43\x73\x04\x09\x99\xaa\xc8\x9e\x76\x22\xf3\
8 \xca\x71\xfb\xa1\xd9\x72\xfd\x94\xa3\x1c\x3b\xfb\xf2\x4e\x39\x38\
9 ";
10
11 sha3.update(b"hello");
12 sha3.update(b" ");
13 sha3.update(b"world");
14 sha3.finalize(&mut output);
15
16 assert_eq!(expected, &output);
17}