Release v0.0.2 (October 4, 2021)
What's new?
Update go.mod to lower requirement from go 1.16 to go 1.15 to match a project about to use CircleHash in production.
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 is based on Google's Abseil C++ library. 🚀 Unoptimized CircleHash64 is fast as Abseil C++ internal hash. CircleHash64 has reliable results for Strict Avalanche Criterion (SAC).
CircleHash64 | Abseil C++ | SipHash-2-4 | |
---|---|---|---|
SAC worst-bit 0-32 byte inputs (lower % is better) |
0.754% w/ 29 bytes |
0.829% w/ 22 bytes |
0.768% w/ 29 bytes |
☝️ Using demerphq/smhasher updated to test all input sizes 0-32 bytes (tests will take a lot longer to run).
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.