#hashing #hash #integer #hash-map #maps #sets #algorithm

yanked int_hash

Very fast, very simple hash algorithm designed for use in integer hash maps & sets

0.2.1 Dec 9, 2018
0.2.0 Dec 8, 2018
0.1.1 Jun 24, 2018
0.1.0 Jun 20, 2018

#50 in #sets

36 downloads per month

Apache-2.0/MIT

2MB
110 lines

int_hash crates.io Documentation

This crate attempts to provide the fastest option for integer key hashmaps in the Rust language.

While the function's performance does seem superior for 64-bit data in benchmarks, it does not clearly surpass fx-hash and seems to be more volatile in practice. Because of this I would recommend the rustc-hash crate for integer hash maps & sets.


lib.rs:

Very fast, very simple hash algorithm designed for use in integer hash maps & sets.

This crate attempts to provide the fastest option for integer key hashmaps. So the algorithm may change if a better method is found for this use case.

When hashing data larger than 64-bits the hasher will fallback to a secondary algorithm suitable for arbitrary data (defaults to FxHasher).

Example

use int_hash::IntHashMap;
let mut map: IntHashMap<u32, &str> = IntHashMap::default();
map.insert(22, "abc");

Dependencies