-
Notifications
You must be signed in to change notification settings - Fork 73
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
Improve buffer-accepting hashes and more #84
Conversation
Also,
|
This commit breaks MacOS Telegram library for encrypted sqlite db. Telegram uses hardcoded seed -137723950 for mmh3.hash |
Hi, thank you for your report! I'll change the seed range to [−231, 232 − 1] as soon as possible, with a clear specification that negative values will be interpreted as their bit-equivalent unsigned positive numbers. |
I concluded negative seeds should be handled on the user side (especially in the case of hard-coded ones), because limiting the value to be unsigned makes code faster and more clean, due to native functions Python/C API offer. But I added a topic about the issue to the FAQ section of README to keep it user-friendly. Thank you so much for reporting the situation. |
This PR introduces the following improvements:
seed
argument is now strictly validated to ensure it falls within the range [0, 0xFFFFFFFF]. AValueError
is raised if the seed is out of range.bool
toAny
.