Skip to content
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

Make the module hashlib-compliant #39

Closed
varunkumar opened this issue Oct 6, 2022 · 2 comments
Closed

Make the module hashlib-compliant #39

varunkumar opened this issue Oct 6, 2022 · 2 comments
Assignees

Comments

@varunkumar
Copy link

mmh3 is currently not hashlib-compliant. This makes it challenging to use it as a replacement for md5 or other cryptographic hashes. A wrapper can be built to make this module hashlib-compliant. One should be able to use the module as hashlib.md5.

update() -- update the current digest with an additional string
digest() -- return the current digest value
hexdigest() -- return the current digest as a string of hexadecimal digits
intdigest() -- return the current digest as an integer
copy() -- return a copy of the current mmh3 object
reset() -- reset state

@hajimes
Copy link
Owner

hajimes commented Mar 24, 2023

Thank you for your ideas.

I'm really interested in the proposal, so I'll try to implement a hashlib-compliant interface in the next update (hopefully in the first half of April).

@hajimes
Copy link
Owner

hajimes commented May 22, 2023

The implementation of this feature has been (experimentally) done in version 4.0.0.

@hajimes hajimes closed this as completed May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants