Release v0.0.1 (Oct 4, 2021)
What's new?
Code coverage is at 100% and validation tests verify nearly 500,000 digests.
What is CircleHash?
CircleHash is a family of non-cryptographic hash functions that pass every test in SMHasher (both rurban/smhasher and demerphq/smhasher). Tests passed include Strict Avalanche Criterion, Bit Independence Criterion, and many others.
CircleHash uses the fractional digits of π as default constants (nothing up my sleeve). The code is simple and easy to audit. I tried to balance competing factors such as speed, digest quality, and maintainability.
CircleHash64 variants produce 64-bit digests and support 64-bit seeds. They are very fast and guaranteed to produce compatible digests within the same major release (SemVer 2.0).
CircleHash64 uses CircleHash64f by default, which is based on Google's Abseil C++ library. CircleHash64 has good results for Strict Avalanche Criterion (SAC).
CircleHash64 | Abseil C++ | wyhash_final3 | SipHash-2-4 | |
---|---|---|---|---|
SAC worst-bit 0-33 byte inputs (lower % is better) |
0.754% w/ 29 bytes |
0.829% w/ 22 bytes |
0.772% w/ 24 bytes |
0.768% w/ 29 bytes |
☝️ Using demerphq/smhasher updated to test all input sizes 0-33 bytes.
Why CircleHash?
I wanted a very fast, maintainable, and easy-to-audit hash function that's free of backdoors and bugs.
It needed to pass all tests in both demerphq/smhasher and rurban/smhasher. It also needed to have sufficiently explained choice of default constants and avoid over-optimizations that increase risk of being affected by bad seeds or efficient seed-independent attacks.