fix comments about hash mixer constant
Some checks failed
format / format (push) Has been cancelled
github pages / Deploy doc (push) Has been cancelled
Build and Test / build (push) Has been cancelled

This commit is contained in:
Simon Cruanes 2026-04-24 12:30:44 -04:00
parent efa429e3c8
commit 4948d74e45
2 changed files with 6 additions and 10 deletions

View file

@ -2,13 +2,11 @@
(** Internal hash implementation.
Combiner: [state ^= chunk; state ^= state >> 32; state *= 0xd6e8feb86659fd93]
Combiner: [state ^= chunk; state ^= state >> 32; state *= 0xc6a4a7935bd1e995]
Finalizer: fmix64 (Murmur3).
Multiplicative constant 0xd6e8feb86659fd93 (rrmxmx family, Pelle Evensen, 2018):
https://mostlymangling.blogspot.com/2018/07/on-mixing-functions-in-fast-hashing.html
Also evaluated in Chris Wellons' hash-prospector:
https://github.com/skeeto/hash-prospector
Multiplicative constant 0xc6a4a7935bd1e995 (MurmurHash2, Austin Appleby):
https://github.com/aappleby/smhasher/blob/master/src/MurmurHash2.cpp
fmix64 constants (Murmur3, Austin Appleby):
https://github.com/aappleby/smhasher

View file

@ -1,13 +1,11 @@
/* This file is free software, part of containers. See file "license" for more details. */
/* Hash implementation: xorshift+multiply combiner with fmix64 finalizer.
Combiner: state ^= chunk; state ^= state >> 32; state *= 0xd6e8feb86659fd93
Combiner: state ^= chunk; state ^= state >> 32; state *= 0xc6a4a7935bd1e995
Finalizer (fmix64, Murmur3): three rounds of xorshift-multiply.
Multiplicative constant 0xd6e8feb86659fd93 (rrmxmx family, Pelle Evensen, 2018):
https://mostlymangling.blogspot.com/2018/07/on-mixing-functions-in-fast-hashing.html
Also evaluated in Chris Wellons' hash-prospector:
https://github.com/skeeto/hash-prospector
Multiplicative constant 0xc6a4a7935bd1e995 (MurmurHash2, Austin Appleby):
https://github.com/aappleby/smhasher/blob/master/src/MurmurHash2.cpp
fmix64 constants 0xff51afd7ed558ccd / 0xc4ceb9fe1a85ec53 (Murmur3, Austin Appleby):
https://github.com/aappleby/smhasher