[−][src]Crate twox_hash
A Rust implementation of the XXHash algorithm.
With a fixed seed
use std::hash::BuildHasherDefault; use std::collections::HashMap; use twox_hash::XxHash; let mut hash: HashMap<_, _, BuildHasherDefault<XxHash>> = Default::default(); hash.insert(42, "the answer"); assert_eq!(hash.get(&42), Some(&"the answer"));
With a random seed
use std::collections::HashMap; use twox_hash::RandomXxHashBuilder; let mut hash: HashMap<_, _, RandomXxHashBuilder> = Default::default(); hash.insert(42, "the answer"); assert_eq!(hash.get(&42), Some(&"the answer"));
Structs
RandomXxHashBuilder | Constructs a randomized seed and reuses it for multiple hasher instances. |
RandomXxHashBuilder32 | Constructs a randomized seed and reuses it for multiple hasher instances. See the usage warning on |
XxHash | Calculates the 64-bit hash. |
XxHash32 | Calculates the 32-bit hash. Care should be taken when using this hash. |