Skip to content

chore: mmh3.hash(token, signed=False) instead of abs() - #290

Closed
anush008 wants to merge 2 commits into
mainfrom
mmh3
Closed

anush008 wants to merge 2 commits into
mainfrom
mmh3

Conversation

@anush008

@anush008 anush008 commented Jul 6, 2024

Copy link
Copy Markdown
Member

Description

I found this is the right way to get unsigned hashes. It generates bigger/stronger values.

Running

import mmh3

abs(mmh3.hash("today"))

returns 22861070. Whereas

import mmh3

mmh3.hash("today", signed=False)

returns 4272106226.

The latter is also consitent with the hashes generated in other langs like https://docs.rs/murmur3/latest/murmur3/.

@anush008
anush008 requested review from generall and joein July 6, 2024 19:22
@generall

generall commented Jul 6, 2024

Copy link
Copy Markdown
Member

we can't change it as it breaks backward compatibility

@anush008

anush008 commented Jul 6, 2024

Copy link
Copy Markdown
Member Author

Understood.

@anush008 anush008 closed this Jul 6, 2024
@anush008
anush008 deleted the mmh3 branch July 6, 2024 21:22
@anush008

anush008 commented Jul 8, 2024

Copy link
Copy Markdown
Member Author

Got the Rust hash to be a consistent lossy cast.
anush008/bm42-rs@94cb9ef.

@RAMZI0TO99 RAMZI0TO99 mentioned this pull request Oct 3, 2026
2 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants