SMhasher scores each hash on speed and failed tests, and sha1 and md5 land very differently
Hash function quality and speed tests
At a glance
- What is it?
- rurban/smhasher is a C++ test suite and a results table for hash functions, covering throughput in MiB per second, cycles per hash and a list of quality problems. Its numbers are comparisons from one table, not a recommendation of any algorithm.
- Who is it for?
- Use SMhasher if you are choosing or writing a non-cryptographic hash and want comparable speed and failure data across dozens of functions in one table. Do not use its table to pick a cryptographic hash, because the quality column records statistical failures and the word insecure is attached only to a few rows.
- Can I use it commercially?
- Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
- Is it still maintained?
- Yes. The repository last received commits 6 days ago.
- What is it written in?
- Mainly C++, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 26, 2026, and from our analysis. They are not legal advice.
Star history
- rurban/smhasher2,184 ★ · +6
| Repository | 2026-10-08 | 2026-11-26 |
|---|---|---|
| rurban/smhasher | 2.2k | 2.2k |
6 Stars in the last 49 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
One row per hash, with throughput, latency, size and failures
The README is dominated by a table with six columns: hash function, MiB/sec, cycles per hash, cycles per map, size and quality problems. Each hash name links to a text file under doc, such as doc/donothing32.txt or doc/crc32.txt, which holds the full output for that function.
The cycles per map column carries a number in parentheses, for example 396.81 (101) for crc32 and 865.21 (6) for md5_32. The README table does not explain that figure in the part available here, so check the doc files or the repository's CMake build before reading it as anything but a second measurement.
The first rows are not real hashes. donothing32, donothing64, donothing128 and NOP_OAAT_read64 do no hashing, and they set the ceiling: roughly 11.5 million MiB/sec and 4.00 cycles per hash for donothing32. Their quality notes read bad seed 0 and test NOP, which marks them as baselines.
The table shows md5 with an empty problems column and sha1 with three
A reader looking for a verdict between old and new cryptographic hashes can read it straight from the rows. md5_32 runs at 359.43 MiB/sec and 638.92 cycles per hash with nothing in the quality column. sha1_32 and sha1_64 run at 353.03 MiB/sec and 1385.80 cycles, and list Sanity, Cyclic low32 and 36.6% distrib. sha2-256 runs at 147.80 MiB/sec and 1374.90 cycles with an empty problems column.
The suite measures distribution and statistical behavior. An empty cell means the tests listed no failure, and it does not make md5 safe against deliberate collisions. Only some rows carry the word insecure, such as crc32, sha1ni and the crc32_hw rows, and the table does not mark md5 that way.
So the table answers which function passes the statistical tests and runs fast. It does not answer which one resists an attacker, and a security decision needs a source other than this README.
Failure labels name specific tests
The quality column uses short labels for the tests a function failed. crc32 shows insecure, 8590x collisions, distrib and PerlinNoise. sha1ni and sha2ni-256 show insecure, sanity, Permutation and Zeroes, plus machine-specific. hasshe2 lists Permutation, TwoBytes, Zeroes and Seed. tabulation32 lists collisions, and poly_1_mersenne fails most tests.
The testing code lives in the repository root as separate files: AvalancheTest.cpp, Bitslice.cpp, Bitvec.cpp, DifferentialTest.cpp, HashMapTest.cpp and KeysetTest.cpp, each with matching headers in several cases. The names tell you which behaviors are covered: avalanche, bit-level, differential, hash map use and keyset tests.
For anyone designing a hash, these are the checks to pass before benchmarking. A fast function that fails Zeroes or Permutation will behave badly on inputs such as all-zero blocks or reordered bytes, and the table lets you see that before you adopt it.
Machine-specific rows mean the numbers depend on your CPU
Several rows are tagged with the instruction set they need. crc32_hw is marked insecure, 100% bias, collisions, distrib, BIC and machine-specific with SSE4.2 or NEON, and crc32_hw1 names x86 SSE4.2. sha1ni and sha2ni-256 are machine-specific too, and sha1ni runs at 1632.88 MiB/sec against 353.03 for sha1_32.
Those gaps come from hardware instructions, so the same function on a CPU without them has no entry to compare. The README does not state which processor produced the table, so the absolute figures should not be copied into a specification.
blake3_c carries the note no 32bit portability, so a 32-bit target cannot use that row at all. Treat the table as a ranking on one machine and rerun the suite on the CPU you ship on before deciding. The repository's CMake files for ARM, ARM64 and MINGW64 cross compilation help with that for those targets.
Many implementations sit in the repository root
The top level holds hash source files directly: City.cpp and City.h with CityCrc.h and CityTest.cpp, MurmurHash1, MurmurHash2 and MurmurHash3, PMurHash, PMP_Multilinear in several variants, HighwayHash.cpp and Pippip.h. Hashes.cpp and Hashes.h register them, and Platform.cpp and Platform.h cover platform differences. A .gitmodules file means some hashes come in as submodules, so a plain clone may leave those directories empty.
The cost is a flat tree. A newcomer sees dozens of files and no folder grouping, so finding the implementation behind a table row means searching for its name. The doc directory output for each hash is easier to read than the sources.
The README's table lists functions such as asconhashv12, sha3-256, the blake2 family, edonr and rmd variants, tabulation and several polynomial hashes, so the suite spans cryptographic, checksum and universal hashing classes in one comparison.
CI configs and a Dockerfile run the suite on a non-root user
The repository carries .travis.yml, .appveyor.yml and .cirrus.yml, and README badges for each, so builds are expected on several platforms. A CMakeLists.txt drives the build, with three cross-compilation files, CMakeARMCross.txt, CMakeARM64Cross.txt and CMakeMINGW64Cross.txt.
The Dockerfile starts from a BASE_IMAGE argument defaulting to fedora, prints uname -a, creates a user named tester, copies the working directory to /work, changes ownership and switches to that user. It is a test harness for running as a non-root account, not a published image.
The README text available here has no build or run commands. A newcomer has to read CMakeLists.txt and CONTRIBUTING.md to learn how to compile and run the tests, and the homepage at rurban.github.io/smhasher holds the published results page.
License is unasserted and there are no releases to cite
GitHub lists the license as NOASSERTION. A LICENSE file is present, but the many included hash implementations come from different authors, and each may carry its own terms, so check the header of any source file before copying it into a product.
There are no GitHub releases, so a result cannot be cited by version. The repository is not archived, and the last push was 2026-10-22. Because the README table is edited as functions are added, the numbers in it are a moving snapshot. Record the commit hash when you quote a figure.
Editorial conclusion
Use SMhasher if you are choosing or writing a non-cryptographic hash and want comparable speed and failure data across dozens of functions in one table. Do not use its table to pick a cryptographic hash, because the quality column records statistical failures and the word insecure is attached only to a few rows. Before trusting a number, rerun the suite on your target CPU, since several rows are marked machine-specific.
Frequently asked questions
Which hash algorithm is best according to SMhasher?
The table names no single best hash. It lists MiB/sec, cycles per hash and quality problems for each function, so the choice depends on the speed and failed tests you can accept.
Are SHA1 and SHA256 the same in the SMhasher results?
No. sha1_32 lists Sanity, Cyclic low32 and 36.6% distrib as quality problems, while sha2-256 has none listed. sha1_32 reaches 353.03 MiB/sec and sha2-256 reaches 147.80 MiB/sec.
Should I use MD5 or SHA256, going by the SMhasher table?
On the statistical tests both rows show no listed problems. md5_32 runs at 359.43 MiB/sec and sha2-256 at 147.80 MiB/sec, but the table does not assess security against attackers.
How do SHA hashes work?
The README does not explain the algorithms. It only measures sha1, sha2 and sha3 variants for speed and for statistical failures, and links a text file with output for each.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/rurban-smhasher)Star history chart for your README
[](https://hysenlabs.com/projects/rurban-smhasher)Was this useful?