https://github.com/lemire/stronglyuniversalstringhashing
Benchmark showing the we can randomly hash strings very quickly with good universality
https://github.com/lemire/stronglyuniversalstringhashing
hashing universality
Last synced: about 1 year ago
JSON representation
Benchmark showing the we can randomly hash strings very quickly with good universality
- Host: GitHub
- URL: https://github.com/lemire/stronglyuniversalstringhashing
- Owner: lemire
- License: other
- Created: 2013-05-13T20:13:50.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2025-01-23T21:02:23.000Z (over 1 year ago)
- Last Synced: 2025-03-29T15:07:59.647Z (about 1 year ago)
- Topics: hashing, universality
- Language: C++
- Homepage:
- Size: 549 KB
- Stars: 136
- Watchers: 10
- Forks: 12
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
StronglyUniversalStringHashing
==============================
Very fast [universal hash
families](https://en.wikipedia.org/wiki/Universal_hashing) on strings.
Sample results on a regular x64 (Skylake) processor:
```
Google's City CPU cycle/byte = 0.216047
64-bit VHASH CPU cycle/byte = 0.215097
64-bit CLHASH CPU cycle/byte = 0.091786
SipHash CPU cycle/byte = 1.414069
```
This software includes the experimental code from the following research papers...
* Daniel Lemire and Owen
Kaser, [Faster 64-bit universal hashing using carry-less
multiplications](http://arxiv.org/abs/1503.03465), Journal of Cryptographic Engineering 6 (3), 2016.
* Dmytro Ivanchykhin, Sergey Ignatchenko, Daniel Lemire, [Regular and almost universal hashing: an efficient implementation](https://arxiv.org/abs/1609.09840), Software: Practice and Experience (to appear).
* Owen Kaser and Daniel Lemire, [Strongly universal string hashing is fast](http://arxiv.org/abs/1202.4961), Computer Journal (2014) 57 (11): 1624-1638.
Acknowledgements
==================
Thanks to Nathan Kurz for noticing that GCC 4.7 requires
no-tree-vectorize to produce correct results.
Usage
======
To test speed:
make benchmark-target
# disable some processor features that add noise to benchmarks:
cd scripts/; sudo ./master.sh; cd ..
./benchmark/benchmark.exe
./benchmark/variablelengthbenchmark.exe
To test correctness of hash functions using PCLMULQDQ:
make test-target
for test in ./test/correctness/*.exe; do $test; done
Or more simply...
./run_unit.sh
Related projects
=================
There is a very simple clhash library in C: https://github.com/lemire/clhash
For a project with similar goals, see: https://github.com/lemire/fasthashing
Licensing
==========
This project is licenced as described in the LICENSE file, with the
following exceptions for code written by other authors:
* smhasher and CityHash are MIT licensed.
* VHASH and siphash are public domain.