From: Arno on
Hello,

looking at MurmurHash which has been mentioned in this group before,
at

http://sites.google.com/site/murmurhash/

there are a number of differences between MurmurHash2A (producing a 32
bit hash), which has been made incremental, and MurmurHash64A
(producing a 64 bit hash), which has not yet been made incremental. In
particular:

MurmurHash2A initializes the hash with a simple

unsigned int h = seed;

while MurmurHash64A does it with

uint64_t h = seed ^ (len * m);

Then, MurmurHash2A has the mixing function

#define mmix(h,k) { k *= m; k ^= k >> r; k *= m; h *= m; h ^= k; }

while MurmurHash64A has

#define mmix(h,k) { k *= m; k ^= k >> r; k *= m; h ^= k; h *= m; }

Note the difference in the order of instructions.

Also, in MurmurHash2A, r=24, but the tail mix is

h ^= h >> 13;
h *= m;
h ^= h >> 15;

while MurmurHash64A has

h ^= h >> r;
h *= m;
h ^= h >> r;

with the same r=47 as in mmix.

I would like to make MurmurHash 64 incremental as well. Are these
small differences intended? Were they made to make MurmurHash2
incremental, and which ones apply to an incremental MurmurHash64?
Thanks for any insight.

Regards,

Arno
 | 
Pages: 1
Prev: Ctalk 0.0.96a 20100627 Released
Next: int to short