Yet another " fastest hashing algorithm"

rlasse1 pts1 comments

GitHub - rrrlasse/intrinhash: Fast hash function for C/C++ and x64/ARM · GitHub

/" data-turbo-transient="true" />

Skip to content

Search or jump to...

Search code, repositories, users, issues, pull requests...

-->

Search

Clear

Search syntax tips

Provide feedback

--><br>We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

-->

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

rrrlasse

intrinhash

Public

Notifications<br>You must be signed in to change notification settings

Fork

Star

main

BranchesTags

Go to file

CodeOpen more actions menu

Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit

History<br>2 Commits<br>2 Commits

demo

demo

README.md

README.md

intrinhash.h

intrinhash.h

View all files

Repository files navigation

intrinhash is currently (2026) the fastest quality hashing library for C/C++ on x64/ARM for long inputs.

It's designed for use cases where you need 256-bit collision free hash values at high speed. It is not cryptographic and not competitive for small keys.

It uses AES-NI/VAES256 on x64 and NEON on ARMv8 which covers basically every PC and smartphone from 2013 or later. Only a very slow fallback is supported for other architectures.

Benchmark and quality

intrinhash passes the xxHash collisionsTest (added here).

It also passes SMHasher and the much harder SMHasher3 (added here) for 32, 64, 128 and 256 bit lengths, even with --extra. Below is its benchmark on a Core i7 for alignment 0 . Only a few popular hashes are included for the slower ones:

Placement<br>Name<br>GiB/sec @ 3.5 GHz<br>Passed tests

1.<br>intrinhash-256-vaes<br>252.51<br>250 / 250

2.<br>falkhash1<br>175.75<br>240 / 250

3.<br>gxhash<br>173.36<br>225 / 250

4.<br>intrinhash-256-aesni<br>170.29<br>250 / 250

5.<br>falkhash2<br>163.10<br>244 / 250

6.<br>AquaHash<br>149.49<br>195 / 250

7.<br>FARSH-32<br>141.47<br>223 / 250

8.<br>CLhash<br>99.21<br>64 / 250

12.<br>XXH3-128<br>97.40<br>214 / 250

13.<br>MeowHash<br>96.80<br>250 / 250

23.<br>CityHashCrc-256<br>49.43<br>217 / 238

28.<br>MetroHash-128<br>38.77<br>233 / 250

29.<br>t1ha1<br>38.56<br>185 / 250

33.<br>CityHash-64<br>37.36<br>205 / 250

66.<br>rapidhash-micro<br>20.08<br>250 / 250

68.<br>wyhash<br>19.95<br>235 / 250

70.<br>komihash<br>18.90<br>250 / 250

It's a header-only library with two methods for integration:

Simple method

#define INTRINHASH_HEADER_ONLY<br>#include "intrinhash.h"

Better method

From one compilation unit (.c or .cpp file) of your own choice:

#define INTRINHASH_IMPLEMENTATION<br>#include "intrinhash.h"

From any other compilation unit:

#include "intrinhash.h"

API

The block mode is simply one function:

intrinhash("Hello", 5, seed, result, hash_len, intrinhash_auto());

Streaming mode lets you call intrinhash_update() repeatedly with data:

intrinhash_state ps;<br>intrinhash_init(&ps, seed, intrinhash_auto());<br>intrinhash_update(&ps, &in[0], 256);<br>intrinhash_update(&ps, &in[256], 100);<br>intrinhash_finalize(&ps, result, hash_len);

The last parameter lets you select what CPU features to use. You can also simply pass the return value of intrinhash_auto().

There is a requirement that all data passed to intrinhash_update() must be divisible by 256 except the last.

About

It uses a 2048-bit internal state with 8 lanes that are lightly mixed, at the cost of a more complex and slow finalizer.

This is the very first version and is still in prototype state. Any feedback is welcome.

About

Fast hash function for C/C++ and x64/ARM

Resources

Readme

Uh oh!

There was an error while loading. Please reload this page.

Activity

Stars

stars

Watchers

watching

Forks

forks

Report repository

Releases

No releases published

Packages

Uh oh!

There was an error while loading. Please reload this page.

Contributors

Uh oh!

There was an error while loading. Please reload this page.

Languages

100.0%

You can’t perform that action at this time.

intrinhash reload search another feedback include

Related Articles