#hash #murmur3 #murmur #hashing


Fast non-cryptographic hash, with the benchmarks to prove it

2 unstable releases

0.2.0 Jun 19, 2023
0.1.2 Dec 14, 2021

#171 in Cryptography

Download history 998/week @ 2023-06-06 844/week @ 2023-06-13 1023/week @ 2023-06-20 1034/week @ 2023-06-27 1002/week @ 2023-07-04 889/week @ 2023-07-11 1229/week @ 2023-07-18 932/week @ 2023-07-25 788/week @ 2023-08-01 905/week @ 2023-08-08 1145/week @ 2023-08-15 1202/week @ 2023-08-22 1017/week @ 2023-08-29 1643/week @ 2023-09-05 1701/week @ 2023-09-12 1532/week @ 2023-09-19

6,096 downloads per month
Used in 17 crates (6 directly)

MIT license

296 lines

GitHub Contributors Stars Build Status Downloads Crates.io


Murmur3 is a fast, non-cryptographic hash function. fastmurmur3 is, in my testing, the fastest implementation of Murmur3.


let bytes: &[u8] = b"hello world";
let x: u128 = fastmurmur3::hash(bytes);


cargo install fastmurmur3



According to current benchmarks:

  • fastmurmur3 is the fastest.
  • xxh3_64 is 1.66x slower and only has a 64-bit value.
  • xxh3_128 is 2.50x slower.
  • fasthash contains the next fastest murmur3 implementation, but is still 4.47x slower than fastmurmur3.


fastmurmur3             time:   [3.0878 ns 3.1215 ns 3.1619 ns]
xxhash_rust::xxh3_64    time:   [5.1473 ns 5.1872 ns 5.2456 ns]
xxhash_rust::xxh3_128   time:   [7.8066 ns 7.8271 ns 7.8499 ns]
fasthash                time:   [13.909 ns 13.960 ns 14.018 ns]
murmur3c                time:   [14.529 ns 14.604 ns 14.684 ns]
murmur3                 time:   [26.084 ns 26.163 ns 26.249 ns]
twox_hash::Xxh3Hash64   time:   [124.23 ns 126.46 ns 128.55 ns]
twox_hash::Xxh3Hash128  time:   [134.62 ns 136.75 ns 138.77 ns]
sha1                    time:   [209.55 ns 211.71 ns 214.88 ns]

Benchmark Future Work

  • These benchmarks are run on a limited input set and with a limited seed set. These more extensive benchmarks need to happen before definitively making the claim that fastmurmur3 is the fastest non-cryptographic hash function.

  • I'm not sure if these benchmarks are unfair to the reference C implementation because of linkage (i.e. rust function gets fully inlined, whereas C implementation stays as a separate fn call because of linking algorithm).

  • Besides speed, these benchmarks could also measure other hash properties like collision-resistance in comparison to other algorithms (xxhash, etc.).

  • It'd be nice to have pretty charts of the benchmarks.

  • I'd like to understand if there's steps I can take to make the benchmarks more reproducible (e.g. setting process priority, failing if it encounters memory contention, etc.)

  • I'd like to improve the benchmarking readout and abstract it into a better comparison tool. Right now, cargo bench and cargo criterion are built for tracking performance of the project over time. I'd like to have a better library for comparing performance within a benchmark group.


The tests for fastmurmur3 perform fuzzing in comparison to the C implementation.


Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

No runtime deps