(Go: >> BACK << -|- >> HOME <<)

MurmurHash: Difference between revisions

Content deleted Content added
BOT--Reverting link addition(s) by 98.247.254.75 to revision 283023950 (http://murmurhash.googlepages.com/murmurhash2_64.cpp)
Undid revision 284374362 by XLinkBot (talk)
Line 14:
The fastest implementation[http://murmurhash.googlepages.com/MurmurHash2.cpp] of MurmurHash2 reads four bytes at a time and generates canonical values only on a processor with Intel [[little-endian]] byte order. For processors that require aligned reads[http://murmurhash.googlepages.com/MurmurHashAligned2.cpp] or have Motorola [[big-endian]] byte order[http://murmurhash.googlepages.com/MurmurHashNeutral2.cpp], there are versions that work correctly but at approximately half speed. The algorithm generates a 32-bit hash value and is optimized for processors with 32-bit or larger registers.
 
There are also two versions[http://codemurmurhash.googlegooglepages.com/p/maatkit/issues/detail?id=19#c4MurmurHash2_64.cpp] available which generate 64-bit hash values, suitable for differentiating among tens of thousands of items without false positives caused by the [[birthday paradox]]. The first, MurmurHash64A, is MurmurHash2 scaled up directly to 64 bits, for maximum performance on 64-bit processors. The second, MurmurHash64B, is designed for 32-bit processors, so it essentially runs a pair of MurmurHash2 algorithms in parallel and combines the results. Both of these generate different hash values from each other and MurmurHash2, and have the same byte order and alignment requirements, except that MurmurHash64A alignment is on 8-byte, not 4-byte, boundaries.
 
===MurmurHash2===
Line 177:
h2 ^= h1 >> 22; h2 *= m;
h1 ^= h2 >> 17; h1 *= m;
h2 ^= h1 >> 19; h2 *= m;
uint64_t h = h1;