-
Notifications
You must be signed in to change notification settings - Fork 469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bit pattern issue #102
Comments
Nope. Firstly it has not really an "initialization" (if one carefully follows the mixing algorithm inside the blocks). Secondly it is not the case here, since 2 x 64 bits buffers get the seed in the low 32bits in: Lines 261 to 262 in 61a0530
But they get complexly mixed hereafter during hashing and finalization phase, so almost all 32bits of seed significantly distributed over the whole hash.
Then it will be not MM3 anymore. Additionally note:
And last but not least, you can have the "seed" as long as you need it - just prefix or suffix the input with some buffer (64 bits or larger) and calculate the hash for whole buffer (with increased length), or calculate it using chain mode (repeated calculation for data in parts), starting or ending with a buffer containing the seed of your arbitrary length. |
smhasher/src/MurmurHash3.cpp
Line 255 in 61a0530
At this line you initialize a 64 bit hash from a 32 bit seed. Effectively forcing the high 32bit to 0 for every call. The mixing will be more patterned down the line. The input seed should be 64bit to ensure a good mix overall.
The text was updated successfully, but these errors were encountered: