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

MurmurHash: Difference between revisions

Content deleted Content added
Line 12:
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://code.google.com/p/maatkit/issues/detail?id=19#c4] 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, andso 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 Murmur2, and have the same byte order and alignment requirements, except that MurmurHash64A alignment is on 8-byte, not 4-byte, boundaries.
 
===MurmurHash2===