HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
rurban
smhasher
C++2015–2026
rurban / smhasher

smhasher

Hash function quality and speed tests

35Distinct people
67Mentions
1Explicit recommenders
2.2KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Hash function quality and speed tests

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

Disochash is a simple prime-multiplication ARX (addition rotation XOR) hash that's high-quality and fast. It's only 120 lines of code. There's lots of great hash functions out…

keepamovin used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 7:24:48 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year67 dated mentions

Observed mentions: 2015-05-28 13:42:43 UTC to 2026-01-21 11:45:24 UTC.

0510152015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments20152016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 6 mentions; 2 submissions, 4 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 7 mentions; 0 submissions, 7 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 14 mentions; 1 submissions, 13 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 9 mentions; 0 submissions, 9 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC505
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC505
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC404
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC505
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC624
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC707
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC14113
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC909
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC404
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC303
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC404
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC101

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
SMhasher Hash function MiB/sec cycl./hash cycl./map size Quality problems donothing32 11536809.55 4.00 - 13 bad seed 0, test NOP donothing64 12269832.97 4.00 - 13 bad seed 0, test NOP donothing128 11961841.48 4.08 - 13 bad seed 0, test NOP NOP_OAAT_read64 11652662.97 14.00 - 47 test NOP BadHash 794.68 72.80 - 48 bad seed 0, test FAIL sumhash 10184.67 29.40 - 417 bad seed 0, test FAIL sumhash32 44755.87 23.46 - 697 UB, test FAIL multiply_shift 8286.63 25.39 209.06 (2) 345 bad seeds & 0xfffffff0, fails most tests pair_multiply_shift 5728.05 39.67 218.48 (12) 609 fails most tests -------------------------- crc32 369.88 142.33 396.81 (101) 363 insecure, 8590x collisions, distrib, PerlinNoise md5_32 359.43 638.92 865.21 (6) 598 md5_64 360.20 640.38 869.55 (6) 662 md5-128 344.63 669.59 856.34 (5) 557 sha1_32 353.03 1385.80 1759.94 (5) 5126 Sanity, Cyclic low32, 36.6% distrib sha1_64 353.03 1385.80 1759.94 (5) 5126 Sanity, Cyclic low32, 36.6% distrib sha1-160 364.95 1470.55 1794.16 (13) 5126 Comb/Cyclic low32 sha2-224 147.13 1354.81 1589.92 (12) 695 Comb low32 sha2-224_64 147.60 1360.10 1620.93 (13) 600 Cyclic low32 sha2-256 147.80 1374.90 1606.06 (16) 663 sha2-256_64 148.01 1376.34 1624.71 (16) 600 sha1ni 1632.88 170.77 379.84 (5) 1321 insecure,sanity, Permutation, Zeroes, machine-specific sha1ni_32 1583.50 172.17 387.70 (4) 1273 machine-specific sha2ni-256 1556.66 180.75 393.79 (5) 1495 insecure,sanity, Permutation, Zeroes, machine-specific sha2ni-256_64 1508.82 184.89 393.07 (6) 1409 Zeroes, machine-specific blake3_c 1298.04 354.25 563.63 (4) 16462 no 32bit portability rmd128 294.42 712.67 930.65 (4) 950 rmd160 202.16 1045.79 1287.74 (16) 950 Cyclic hi32 rmd256 366.21 615.39 830.04 (7) 1026 edonr224 863.77 304.76 496.66 (3) 834 edonr256 870.97 296.40 517.82 (6) 834 blake2s-128 295.30 698.09 1059.24 (51) 329 blake2s-160 215.01 1026.74 1239.54 (11) 329 blake2s-224 207.06 1063.86 1236.50 (20) 329 blake2s-256 215.28 1014.88 1230.38 (28) 329 blake2s-256_64 211.52 1044.22 1228.43 (8) 323 blake2b-160 356.08 1236.84 1458.15 (12) 505 blake2b-224 356.59 1228.50 1425.87 (16) 505 blake2b-256 355.97 1232.22 1443.31 (19) 505 blake2b-256_64 356.97 1222.76 1435.03 (9) 501 asconhashv12 144.98 885.02 1324.23 (38) 4341 asconhashv12_64 159.33 402.54 473.15 (4) 6490 sha3-256 100.58 3877.18 4159.79 (37) 1686 PerlinNoise sha3-256_64 100.57 3909.00 4174.63 (16) 1630 PerlinNoise hasshe2 2879.93 62.47 272.34 (2) 505 Permutation,TwoBytes,Zeroes,Seed poly_1_mersenne 1278.37 63.42 244.41 (1) 479 fails most tests poly_2_mersenne 1391.90 69.97 255.44 (3) 479 poly_3_mersenne 1320.15 80.81 263.12 (2) 479 poly_4_mersenne 1393.93 89.07 262.97 (2) 479 tabulation32 5819.40 40.16 233.00 (3) 848 collisions tabulation 7407.94 39.83 240.25 (4) 554 crc32_hw 5537.79 40.80 225.65 (3) 653 insecure, 100% bias, collisions, distrib, BIC, machine-specific (SSE4.2/NEON) crc32_hw1 7626.17 50.21 228.50 (2) 696 insecure, 100% bias, collisions, distrib, BIC, machine-specific (x86 SSE4.2) crc64_hw 5579.17 40.87 202.19 (1) 652 insecure, 100% bias, collisions, distrib, BIC, machine-specific (SSE4.2/NEON) crc32_pclmul 7963.20 106.02 567.70 (3) 254 insecure, 100% bias, collisions, distrib, BIC, machine-specific (x86 SSE4.2+PCLMUL) crc64_jones1 1673.67 83.00 249.16 (2) insecure, 100% bias, collisions, distrib, BIC, machine-specific crc64_jones2 2968.07 314.60 253.01 (3) insecure, 100% bias, collisions, distrib, BIC, machine-specific crc64_jones3 3398.80 302.59 258.16 (8) insecure, 100% bias, collisions, distrib, BIC, machine-specific crc64_jones 3512.66 80.70 251.40 (2) insecure, 100% bias, collisions, distrib, BIC, machine-specific o1hash 11530366.92 18.40 206.94 (1) 101 insecure, no seed, zeros, fails all tests fibonacci 15409.62 22.67 872.83 (3) 1692 UB, zeros, fails all tests FNV1a 754.70 75.28 226.30 (2) 54 bad seed, zeros, fails all tests FNV1A_Totenschiff 6166.85 26.60 235.71 (2) 270 UB, zeros, fails all tests FNV1A_Pippip_Yurii 24196.44 86.25 539.41 (3) 603 bad seeds, UB, sanity, x64 AESNI only FNV1a_YT 13481.70 30.67 233.71 (7) 336 bad seed, UB, fails all tests FNV2 5630.87 32.09 207.08 (1) 278 fails all tests FNV64 747.70 74.18 189.18 (1) 70 fails all tests FNV128 408.59 130.82 299.47 (20) 153 fails all tests k-hash32 2227.90 53.85 255.78 (2) 808 insecure, zeros, UB, bad seeds, fails all tests k-hash64 2492.66 48.18 242.58 (2) 609 insecure, zeros, UB, bad seeds, fails all tests fletcher2 15410.12 20.72 345.55 (5) 117 bad seed 0, UB, fails all tests fletcher4 15603.68 21.24 320.09 (2) 117 bad seed 0, UB, fails all tests bernstein 1032.00 59.04 225.09 (3) 56 bad seed 0, fails all tests sdbm 772.01 71.67 220.09 (2) 54 bad seed 0, fails all tests x17 765.01 75.61 225.81 (2) 65 99.98% bias, fails all tests libiberty 618.39 86.58 220.95 (2) 37 insecure, 100% bias, fails all tests, bad seed gcc 612.10 88.44 224.62 (2) 55 insecure, 100% bias, fails all tests, bad seed JenkinsOOAT 615.60 111.23 251.08 (2) 150 bad seed 0, 53.5% bias, fails all tests JenkinsOOAT_perl 631.79 93.13 232.44 (1) 65 bad seed 0, 1.5-11.5% bias, 7.2x collisions, BIC, LongNeighbors MicroOAAT 730.89 78.25 236.07 (3) 78 100% bias, distrib, BIC pearsonhash64 439.85 123.07 213.68 (1) Avalanche, Seed, SSSE3 only. broken MSVC pearsonhash128 438.49 123.81 212.89 (2) Avalanche, Seed, SSSE3 only. broken MSVC pearsonhash256 440.63 120.72 224.63 (2) Avalanche, Seed, SSSE3 only. broken MSVC VHASH_32 13084.37 65.45 280.14 (2) 1231 sanity, Seed, MomentChi2 VHASH_64 13217.64 64.90 270.04 (2) 1231 sanity, Seed, Sparse farsh32 27583.89 65.65 266.64 (2) 944 insecure: AppendedZeroes, collisions+bias, MomentChi2, LongNeighbors farsh64 13558.69 113.74 327.26 (3) 944 insecure: AppendedZeroes, collisions+bias, MomentChi2, LongNeighbors farsh128 7055.39 229.42 375.57 (4) 944 insecure:
Read the full README on GitHub

What Hacker News says

4 sources
You are welcome. I wanted add another point. rurban does have a bit of a point. The hash functions you referenced in your article are generally old and low quality, and slow. FNV is neither a good hash, nor is it fast. FNV_yt is very fast, but not the best quality hash function, it fails many tests in SMHasher, including some I personally consider dealbreaker: failing avalanche tests is unacceptable. Both rurban and I have (independently) spent considerable time testing about 100 hash functions using the hash test suite smhasher. In addition I have greatly enhanced smhasher, and included test results and graphs in my version. Included in my fork is the --stream option so you can test different hash functions in counter mode with tools like the dieharder RNG test suite. https://github.com/demerphq/smhasher https://github.com/rurban/smhashe
Read the rest
r These are the FNV test results from my version of SMHasher: FNV1a 32 32 32 FAILED 99 of 183 tests. Avalanche: 17-41, Crc-MultiCollision: 81, 83, 85-86, 88-91, 94, 96-98, 100, Cyclic: 42-52, Hi-Lo: 157-158, HiBit-Null: 150-152, Highbits2: 147-149, Highbits: 144-146, LowBit-Null: 153-155, Lowbits: 142-143, Murmur2-MultiCollision: 101-110, Murmur3A-MultiCollision: 111, 113, 117, 119-120, Murmur3F-MultiCollision: 122-127, 129-130, OverAll: 183, Text: 160-165, TwoBytes: 54-56, 63, Zeroes: 167-168 FNV1a_YT 32 32 32 FAILED 67 of 181 tests. Avalanche: 15-39, Differential: 9-14, Hi-Lo: 154-156, HiBit-Null: 148-150, Highbits2: 145-147, Highbits: 142-144, Lowbits: 139-141, OverAll: 181, Sparse: 74-78, Text: 157-158, 160-163, TwoBytes: 51, 53-61 FNV64 64 64 64 FAILED 66 of 183 tests. Avalanche: 17-41, Cyclic: 43-45, 47, 49, 51-52, Hi-Lo: 157-158, HiBit-Null: 151-152, Highbits2: 148-149, Highbits: 145-146, LowBit-Null: 154-155, Lowbits: 142-143, OverAll: 183, Sparse: 65-67, 69, 71, 73, 75, 77, 79-80, Text: 160-162, 164-165, TwoBytes: 54-56, 58, 60, 62-63, Words: 182, Zeroes: 167-168 You can see text view of the full list at: https://github.com/demerphq/smhasher/blob/master/doc/summary... Also after reading this thread I added some graphs comparing performance of other hashes, including some that I have developed using genetic algorithm for use in Perl. Some of those hashes have hash-time performance at the top of the envelope (StadtX is very fast). https://github.com/demerphq/smhasher/blob/master/doc/graph/F... https://github.com/demerphq/smhasher/blob/master/doc/graph/F... https://github.com/demerphq/smhasher/blob/master/doc/graph/F... https://github.com/demerphq/smhasher/blob/master/doc/graph/F... You may also be interested in looking at https://github.com/demerphq/smhasher/blob/master/HashAnatomy... Good luck!
In Brief Introduction To General Purpose Hash Functions
ad 1: https://stackoverflow.com/questions/31954237/pseudo-random-g... has some answers. ad 2: in most measurable stats fnv1 is better than djb. practical throughput, time if inlined, cachegrind cost model (4x!). fnv also produces less collisions with average keys. only in pure cycle/hash djb is a bit better. https://github.com/rurban/smhasher#smhasher https://github.com/rurban/perl-hash-stats#perl-hash-stats > ad 3: Is hash function efficiency that important when neither of the hash functions DJB or FNV1 posses good distributive qualities? It depends entirely on the use case. Usage in hash tables is totally different to usage as file or block checksum or crypto. Besides looking how many bis of the keys are really used or how easy it is to create collisions, it also depends if the keys are random length strings, aligned buffers or plain i
Read the rest
ntegers. Both DJB and FNV1 are considered bad regarding their stats. But they are small and fast.
In Brief Introduction To General Purpose Hash Functions

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.