Experimental · non-cryptographic

hayahash64

A small, fast, portable 64-bit hash function. It is a successor experiment to ChibiHash v1 and v2, with higher measured speed and the same strict portability rules.

Output
64-bit
API
hayahash64(key, len, seed)
Targets
C99 and no_std Rust
Quality
188/188 SMHasher3 tests
Verify
0x6B558D9D
License
Public domain / Unlicense
188/188 SMHasher3 tests passed
26.8 GB/s 1 MiB input, Apple M1
9.64 B/cy SMHasher3 bulk test
31.4 cy Average, 1–31 byte keys

Use

The reference implementation is one C header. The Rust port is bit-exact against it.

#include "hayahash.h"

uint64_t h = hayahash64(buf, len, seed);

Rust

View port
let h = hayahash::hayahash64(buf, seed);

Properties

Portable

No platform-specific path

No SIMD, 128-bit multiply, hardware-specific instructions, or undefined behavior. Output is independent of host endianness.

Fast

Short dependency chains

Eight independent lanes process 64-byte blocks. Tail reads overlap, so no byte-at-a-time tail loop is required.

Checked

Full current test suite

The C reference passes 188/188 SMHasher3 tests. The Rust port checks the verification value and shared known-answer vectors.

Design in four points

Bulk path
Eight lanes keep the loop-carried path to an add → multiply chain over 64-byte blocks.
Absorb
Each lane absorbs the current stripe plus a rotated copy of the previous stripe, making the absorb sequence injective by first-difference induction.
State
Seed and input length are premixed. Lane constants are derived from that value and one multiplier constant.
Short inputs
Inputs up to 16 bytes use overlapping whole-word reads, independent bijective injections, two multiplies, and a strong finalizer.

Read the design summary and constraints →

Do not use for

Security boundaries

  • Message authentication
  • Password hashing
  • Adversarial collision resistance
  • Any cryptographic purpose

Stable persisted identifiers

This is an experimental prototype. Digest compatibility is not promised between revisions.