sunfish 0.6.0

Web Application Build Tool
Documentation
1
2
3
4
5
6
7
8
9
10
use sha2::Digest;

pub fn hash(bytes: impl AsRef<[u8]>) -> String {
	let mut hash: sha2::Sha256 = Digest::new();
	hash.update(bytes);
	let hash = hash.finalize();
	let hash = hex::encode(hash);
	let hash = &hash[0..16];
	hash.to_owned()
}