feat: replace mixHash implementation
We are now using part of the murmur hash like Scala. For additional information and context, see https://leanprover.zulipchat.com/#narrow/stream/147302-lean4-maintainers/topic/Increasing.20.60Expr.2Ehash.60.20to.2064.20bits/near/313114719
This commit is contained in:
parent
8fc3d77a0b
commit
e5681ac141
1 changed files with 9 additions and 5 deletions
|
|
@ -21,11 +21,15 @@ inline unsigned hash(unsigned h1, unsigned h2) {
|
|||
return h2;
|
||||
}
|
||||
|
||||
inline uint64 hash(uint64 h1, uint64 h2) {
|
||||
h2 -= h1; h2 ^= (h1 << 16);
|
||||
h1 -= h2; h2 ^= (h1 << 32);
|
||||
h2 -= h1; h2 ^= (h1 << 20);
|
||||
return h2;
|
||||
inline uint64 hash(uint64 h, uint64 k) {
|
||||
uint64 m = 0xc6a4a7935bd1e995;
|
||||
uint64 r = 47;
|
||||
k *= m;
|
||||
k ^= k >> r;
|
||||
k ^= m;
|
||||
h ^= k;
|
||||
h *= m;
|
||||
return h;
|
||||
}
|
||||
|
||||
inline unsigned hash_ptr(void const * ptr) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue