mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2026-05-05 17:04:25 -04:00
change cchash constant
from murmur2
This commit is contained in:
parent
f9ba2e8997
commit
4cafc2d2c5
1 changed files with 5 additions and 1 deletions
|
|
@ -19,7 +19,10 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#define HASH_MUL UINT64_C(0xd6e8feb86659fd93)
|
// from murmur2: https://chromium.googlesource.com/external/smhasher/+/c8e8bf81bc6041d6d836365a501a0a96830d2d81/MurmurHash2.cpp
|
||||||
|
#define HASH_MUL UINT64_C(0xc6a4a7935bd1e995)
|
||||||
|
|
||||||
|
// from murmur3: https://github.com/aappleby/smhasher/blob/master/src/MurmurHash3.cpp#L81
|
||||||
#define FMIX_C1 UINT64_C(0xff51afd7ed558ccd)
|
#define FMIX_C1 UINT64_C(0xff51afd7ed558ccd)
|
||||||
#define FMIX_C2 UINT64_C(0xc4ceb9fe1a85ec53)
|
#define FMIX_C2 UINT64_C(0xc4ceb9fe1a85ec53)
|
||||||
|
|
||||||
|
|
@ -31,6 +34,7 @@ static inline uint64_t hash_combine(uint64_t state, uint64_t chunk)
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// fmix64 from murmur3
|
||||||
static inline uint64_t fmix64(uint64_t h)
|
static inline uint64_t fmix64(uint64_t h)
|
||||||
{
|
{
|
||||||
h ^= h >> 33;
|
h ^= h >> 33;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue