1//! Utility functions used throughout the modules. 2 3use std::hash::{Hash, Hasher}; 4use twox_hash::XxHash64; 5 6pub fn calculate_hash<T: Hash + ?Sized>(t: &T) -> u64 { 7 let mut s = XxHash64::default(); 8 t.hash(&mut s); 9 s.finish() 10}