feat: add highwayhash
This commit is contained in:
12
__crypto/highwayhash/src/main.rs
Normal file
12
__crypto/highwayhash/src/main.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
use highway::{HighwayHash, HighwayHasher, Key};
|
||||
|
||||
fn main() {
|
||||
let res = HighwayHasher::default().hash256("hello world".as_bytes());
|
||||
println!("{:x?}", res);
|
||||
let res = HighwayHasher::default().hash256(&[0xff]);
|
||||
println!("{:x?}", res);
|
||||
let mut hasher256 = HighwayHasher::new(Key([1, 2, 3, 4]));
|
||||
hasher256.append(&[0xff]);
|
||||
let res: [u64; 4] = hasher256.finalize256();
|
||||
println!("{:x?}", res);
|
||||
}
|
||||
Reference in New Issue
Block a user