#hash #integer

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

#5 in #superior

Download history 6/week @ 2023-11-02 5/week @ 2023-11-09 7/week @ 2023-11-16 8/week @ 2023-11-23 13/week @ 2023-11-30 3/week @ 2023-12-07 8/week @ 2023-12-14 12/week @ 2023-12-21 2/week @ 2023-12-28 4/week @ 2024-01-04 4/week @ 2024-01-11 13/week @ 2024-01-18 7/week @ 2024-01-25 9/week @ 2024-02-01 7/week @ 2024-02-08 48/week @ 2024-02-15

71 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