axhash 0.1.1

Fast non-cryptographic hash function for Rust with no_std support and strong HashMap performance.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use axhash::AxBuildHasher;
use std::collections::HashMap;

fn main() {
    let mut cache: HashMap<u64, &'static str, AxBuildHasher> =
        HashMap::with_hasher(AxBuildHasher::with_seed(0xfeed_beef));

    cache.insert(10, "pending");
    cache.insert(20, "confirmed");
    cache.insert(30, "finalized");

    for key in [10_u64, 20, 30] {
        println!("key {key} => {:?}", cache.get(&key));
    }
}