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

Add buffer argument to hasher constructors #83

Merged
merged 3 commits into from
Sep 16, 2024
Merged

Conversation

hajimes
Copy link
Owner

@hajimes hajimes commented Sep 16, 2024

This PR introduces the optional parameter data, which accepts a bytes-like object implementing the buffer protocol, as the first argument. This change aligns the API of Python’s standard hashlib library.

Backward Compatibility: In previous versions, the first optional argument was seed, an integer. This update introduces a backward-incompatibility, as the new argument takes precedence. For example, code like mmh3.mmh3_x64_128(1234) will now raise an error TypeError: a bytes-like object is required, not 'int'.

Version Update: Due to this breaking change, I will bump the version to 5.0.0 in accordance with semantic versioning.

@hajimes hajimes merged commit ce573f9 into master Sep 16, 2024
64 checks passed
@hajimes hajimes deleted the feature/fix-hasher branch September 16, 2024 13:13
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.

1 participant