Skip to content

Add murmur hash support #47

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

Merged
merged 9 commits into from
Mar 21, 2017
Merged

Add murmur hash support #47

merged 9 commits into from
Mar 21, 2017

Conversation

mredolatti
Copy link
Contributor

@mredolatti mredolatti commented Mar 16, 2017

This pull request addresses the following issues:

  • Adds support for Murmur3 (32 bits) hash algorithm
    • Provides the SDK with two choices: native python and compiled C (considerably faster) libraries.
    • The user can now include an optional dependency when installing via pip cpphash which builds and enables a C++ implementation of this hash function.
  • Adds tests for Murmur3 hash function. Passing in Python2.7 & Python 3.4 for both ASCII & utf8 encoded keys.
  • Fixed some linter errors according to PEP 8 standard

In order to include the C++ implementation of this hash function, a fork was created for this project https://github.com/splitio/mmh3, which was adapted to support Python2 as well and then published to SplitIO's Pypi account.

This can be tested locally using the following commands:

  • virtualenv -p <PYTHON_EXECUTABLE> venv & source venv/bin/activate
  • git clone https://github.com/splitio/python-client
  • cd python-client
  • pip install -e . (python implmementation of hash) or pip install -e .[cpphash] (C++ implementation).
  • python setup.py nosetests

PYTHON_EXECUTABLE can be used to select which python version (installed on your system) should be used to create the virtualenv where the client will be tested.

Once this is published to PyPI it will be possible to install it using:
pip install splitio or
pip install splitio[redis] or
pip install splitio[redis,cpphash],
etc...

@mredolatti mredolatti changed the base branch from master to development March 16, 2017 16:11
@patricioe
Copy link
Contributor

Thank you.

@mredolatti @sarrubia are we waiting for those folks to accept our PR? can we fork and publish it ourselves?

@mredolatti
Copy link
Contributor Author

Hi @patricioe, we have already forked it into split's github account, https://github.com/splitio/mmh3.
And it's been uploaded to splitio's pypi account as splitmmh3.

@sarrubia sarrubia merged commit 89e44f8 into development Mar 21, 2017
@mmelograno mmelograno deleted the addMurmurHashSupport branch October 16, 2020 19:19
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.

3 participants