Closed Novum closed 5 years ago
After L321 and L322 aren't h1 and h2 exactly the same value?
No. Short explanation:
h1 = 0x0123;
h2 = 0x4567;
_
h1 += h2;
h2 += h1;
?
h1 : 0x468A
h2 : 0x8BF1
Operator +=
is a left modifier that increases left part with value of right part, considering type (thus can overflow ~ be smaller as the sum of both). Thus normally h1 != h2 after both operators used.
Thus L321 and L322 is quasi linear "bit-mixer" of two 64-bit integers:
h1 += h2
- add h2 to h1 and save 64-bit truncated value into h1h2 += h1
- add (previously modified) h1 to h2 and save 64-bit truncated value into h2If I'm not mistaken it's just 2 * fmix64( h1 + h2 ) for out[0] and out[1]?
You are... so it is not the result you're assuming.
Nevermind, I'm an idiot 🤦♂️
https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash3.cpp#L321
After L321 and L322 aren't h1 and h2 exactly the same value? Which in turn also means the 64 bit halfs of the 128 bit output are identical?
If I'm not mistaken it's just 2 * fmix64( h1 + h2 ) for out[0] and out[1]?