File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 88#define HASHUTILS_H
99
1010/*
11- * Combine two hash values, resulting in another hash value, with decent bit
12- * mixing.
11+ * Combine two 32-bit hash values, resulting in another hash value, with
12+ * decent bit mixing.
1313 *
1414 * Similar to boost's hash_combine().
1515 */
@@ -20,6 +20,18 @@ hash_combine(uint32 a, uint32 b)
2020 return a ;
2121}
2222
23+ /*
24+ * Combine two 64-bit hash values, resulting in another hash value, using the
25+ * same kind of technique as hash_combine(). Testing shows that this also
26+ * produces good bit mixing.
27+ */
28+ static inline uint64
29+ hash_combine64 (uint64 a , uint64 b )
30+ {
31+ /* 0x49a0f4dd15e5a8e3 is 64bit random data */
32+ a ^= b + 0x49a0f4dd15e5a8e3 + (a << 54 ) + (a >> 7 );
33+ return a ;
34+ }
2335
2436/*
2537 * Simple inline murmur hash implementation hashing a 32 bit integer, for
You can’t perform that action at this time.
0 commit comments