forceps/
hash.rs

1pub(crate) const HASH_LEN: usize = 16;
2
3/// Type definition for an array of bytes that make up an 16-byte hash (e.g., md5, xx3, etc.).
4pub type HashBytes = [u8; HASH_LEN];
5
6#[inline]
7pub fn create(data: &[u8]) -> HashBytes {
8    #[cfg(feature = "xxhash")]
9    return twox_hash::XxHash3_128::oneshot(data).to_be_bytes();
10    #[cfg(not(feature = "xxhash"))]
11    return md5::compute(data).0;
12}