• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 use core::hash::{Hash, Hasher};
2 
3 #[doc(hidden)]
hash<V: Hash>(value: &V) -> usize4 pub fn hash<V: Hash>(value: &V) -> usize {
5     #[cfg(feature = "std")]
6     let mut hasher = std::collections::hash_map::DefaultHasher::new();
7     #[cfg(not(feature = "std"))]
8     let mut hasher = crate::sip::SipHasher13::new();
9 
10     Hash::hash(value, &mut hasher);
11     Hasher::finish(&hasher) as usize
12 }
13