Last active
March 20, 2021 23:05
-
-
Save zeux/25b490b07b4873efc08bd37c843777a4 to your computer and use it in GitHub Desktop.
MurMurHash finalizers as 32-bit integer/pointer hashers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint32_t murmur2(uint32_t h) | |
{ | |
h ^= h >> 13; | |
h *= 0x5bd1e995; | |
h ^= h >> 15; | |
return h; | |
} | |
uint32_t murmur3(uint32_t h) | |
{ | |
h ^= h >> 16; | |
h *= 0x85ebca6bu; | |
h ^= h >> 13; | |
h *= 0xc2b2ae35u; | |
h ^= h >> 16; | |
return h; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment