Computes a 64-bit hash of a key using the xxHash algorithm. This hash function is used to: 1. Determine which shard a key-value pair belongs to (via modulo) 2. Enable fast lookups by storing the hash alongside the data # Arguments `key` - The key to hash # Returns A 64-bit hash value
(key: &K)
| 41 | /// # Returns |
| 42 | /// A 64-bit hash value |
| 43 | pub(crate) fn hash_key<K>(key: &K) -> u64 |
| 44 | where |
| 45 | K: Hash, |
| 46 | { |
| 47 | let mut hasher = XxHash64::with_seed(0); |
| 48 | key.hash(&mut hasher); |
| 49 | hasher.finish() |
| 50 | } |
| 51 | |
| 52 | /// Serialization job for a single `HashMap` shard. |
| 53 | /// |