Add canonical hash function

This commit is contained in:
Paul Hauner 2018-09-19 14:45:03 +10:00
parent 7adc2ddd63
commit 693d635f8c

6
lighthouse/utils/hash.rs Normal file
View File

@ -0,0 +1,6 @@
use super::blake2::blake2b::blake2b;
pub fn canonical_hash(input: &[u8]) -> Vec<u8> {
let result = blake2b(64, &[], input);
result.as_bytes()[0..32].to_vec()
}