#hash #hasher #hashmap #hashset

archived nohash-hasher

An implementation of std::hash::Hasher which does not hash at all

5 releases

0.2.0 Feb 17, 2020
0.1.3 Jan 22, 2020
0.1.2 Sep 20, 2019
0.1.1 Nov 15, 2018
0.1.0 Sep 18, 2018

#16 in #hashset

Download history 48533/week @ 2022-11-27 49216/week @ 2022-12-04 48801/week @ 2022-12-11 43830/week @ 2022-12-18 28807/week @ 2022-12-25 42228/week @ 2023-01-01 49791/week @ 2023-01-08 51787/week @ 2023-01-15 48375/week @ 2023-01-22 52746/week @ 2023-01-29 58875/week @ 2023-02-05 68022/week @ 2023-02-12 57488/week @ 2023-02-19 62878/week @ 2023-02-26 64997/week @ 2023-03-05 66570/week @ 2023-03-12

257,196 downloads per month
Used in 659 crates (57 directly)

Apache-2.0 OR MIT

246 lines


For an enabled type T, a NoHashHasher<T> implements std::hash::Hasher and uses the value set by one of the write_{u8, u16, u32, u64, usize, i8, i16, i32, i64, isize} methods as its hash output.

NoHashHasher does not implement any hashing algorithm and can only be used with types which can be mapped directly to a numeric value. Out of the box NoHashHasher is enabled for u8, u16, u32, u64, usize, i8, i16, i32, i64, and isize. Types that should be used with NoHashHasher need to implement [IsEnabled] and by doing so assert that their Hash impl invokes only one of the Hasher::write_{u8, u16, u32, u64, usize, i8, i16, i32, i64, isize} methods exactly once.


Licensed under either of

at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

No runtime deps


  • std