use std::convert::TryInto;
use blake2::digest::{Update, VariableOutput};
use blake2::VarBlake2b;
pub fn blake2b256_hash(bytes: &[u8]) -> Box<[u8; 32]> {
let mut hasher = VarBlake2b::new(32).unwrap();
hasher.update(bytes);
let hash = hasher.finalize_boxed();
hash.try_into().unwrap()
}