Implementation of the Jump Consistent Hash algorithm
Project description
Jump Consistent Hash
Python and C implementation of the jump consistent hash algorithm by John Lamping and Eric Veach[1]. Tested on Python 2.7 and 3.4+.
Install
To install Jump Consistent Hash, simply run this simple command in your terminal of choice:
$ pip install jump-consistent-hash
The C implementation is optional but is about 10x faster than the pure Python implementation in CPython.
Usage
>>> import jump
>>> jump.hash(256, 1024)
520
If you want to use a str as a key instead of an int, you can pass it through a hash function to compute a real key. Here’s a couple of examples using Python 3:
>>> import hashlib
>>> int(hashlib.md5(b'127.0.0.1').hexdigest(), 16)
325870950296970981340734819828239218902
>>> int(hashlib.sha1(b"127.0.0.1").hexdigest(), 16)
431133456357828263809343936597625557575256328153
>>> import binascii
>>> binascii.crc32(b'127.0.0.1') & 0xffffffff
3619153832
>>> abs(hash('127.0.0.1'))
7536019783825143230
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Close
Hashes for jump-consistent-hash-3.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d90473cc2cc237e4efaccaa8023fef4df0f46a871deb3ce80229268fc9a841fe |
|
MD5 | 6b70bb99c0b69cb366f384f506aa71c3 |
|
BLAKE2b-256 | c6de9be5c3ac6b114ec2023aa145c0cc8d5e887874df355632c967ee08bfb9a7 |
Close
Hashes for jump_consistent_hash-3.1.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1183f05373561262316f0d1be83802058ee7924b0be50f5e8763b0228b85266 |
|
MD5 | 9499e02d2ef294be74e8d78c55e01b9e |
|
BLAKE2b-256 | 3c23d5e18eedb7477e5af45f3aa2e36c670fb9e5c4bd4807ad2104a4b5a6597f |
Close
Hashes for jump_consistent_hash-3.1.1-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | daec93a08a6eb8996595b078a76b0bebc8903d4f3841a7ac8c8a60910cc8b069 |
|
MD5 | 9c34f390cb0c2f11e2e6b93c723c24e4 |
|
BLAKE2b-256 | 3775d37996ceb17db18232d5acd1d97702b15bd467768d9239232da7e3f97632 |
Close
Hashes for jump_consistent_hash-3.1.1-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a55bf1bfb1069e8f86c36de31dff0888f64905b9d72ea3916ab80f16365af1e |
|
MD5 | 48b896fd4a2649957ba2fba6b5748f7c |
|
BLAKE2b-256 | 64a4bfdae7dfdecb198ff4112a7111b483edf9ecd1317f6b496489f86f4967fd |
Close
Hashes for jump_consistent_hash-3.1.1-cp38-cp38-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e1b112fb4038461f42419fe39fb6232ee16b5080e2ac68eb6f5c5911ce0e843 |
|
MD5 | 2fa68db2a5e12a33c0bd6b14fb5b2fdb |
|
BLAKE2b-256 | 11960ed1ae90417bb063a5e65d089d74a54d4a3f0b3a4c434b7ac2d501b1fb5a |
Close
Hashes for jump_consistent_hash-3.1.1-cp38-cp38-macosx_10_13_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f49ad161c9672b776e9baedec088d7f2857399251af49f21167777aa5a9de495 |
|
MD5 | d78d323351aff77bd0d4c117437226ac |
|
BLAKE2b-256 | 1ac8ecccd81c4bf43375fec5e7c89ba5d9e34acfe7dc12734e2cb82976370a0d |
Close
Hashes for jump_consistent_hash-3.1.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae0940e922cebc1cf22226329bf5e06920357f8576ff1eefd232c9c2ac4b2f21 |
|
MD5 | 9459eddb22754a67491a736780eb1583 |
|
BLAKE2b-256 | 8290ec581a37115f3d97825289461684879b5d85e4f970d3e6ab924fd67dee82 |
Close
Hashes for jump_consistent_hash-3.1.1-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7f257508e1ad7d21476c9b0e700a06b8935e6f72bd77026d6258ae49f3779c1 |
|
MD5 | e5d3a239f2cfe1b20eba59e6df3f1713 |
|
BLAKE2b-256 | 298e7356523a7384c7ee27d81305f7239d5bb2eeb1afe58ec4827f7299ea5875 |
Close
Hashes for jump_consistent_hash-3.1.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef89468d8db92b8540e9d2879226de342aa669733b861e366adb67bafe55c149 |
|
MD5 | c93c3d7e4545222cf6a58910be648e96 |
|
BLAKE2b-256 | 9cd0593c43e33d237914f4cc609ef4a776d77a2a134146ee3192c48387ca79b3 |
Close
Hashes for jump_consistent_hash-3.1.1-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ade5b4029e2857925459ccf0d79b10c754dd2e67eee10bfa52429802774017f |
|
MD5 | 0d6d0f7179db096e5c7f1dc5e4e77046 |
|
BLAKE2b-256 | 7c5f831fc42da3a9c04805d0aa7b2fd6c1ff14082fec6f5c7620d25db9c9096a |
Close
Hashes for jump_consistent_hash-3.1.1-cp37-cp37m-macosx_10_13_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c8b21d06c4d91c6f208f59a75b0f938e43272f6fc3a131f73d274ec2dc7bfbf |
|
MD5 | 9c2ffd712161397e42318ceb500bde91 |
|
BLAKE2b-256 | 7e3cc08dfaae0c24a00e868d03e34a6e1cfa7a10f3340415e92545a9a1975a4e |
Close
Hashes for jump_consistent_hash-3.1.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e87a073af97ca16c2dec5827e409f56e2df8678b28b24ba0c1cc5268c0f21cd0 |
|
MD5 | 75fad8611e02973cfc6dd15087b04ebd |
|
BLAKE2b-256 | 9bb0ac8feb6e0bd39c1cc5acdeb0acd3ac9036a54d99bb449eeb70bff70e6c1c |
Close
Hashes for jump_consistent_hash-3.1.1-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e840c02433e5d40b15b6639a4bd6028c7058f97e78edcc6dfb81d8c703281f79 |
|
MD5 | 8ac6ff4bbb451f2e181a6c91ef3f5a36 |
|
BLAKE2b-256 | dc7d191a04af4ea2b5df3100f8eb9873d046fb2fbec2086f6ea9ad9a3ba0d449 |
Close
Hashes for jump_consistent_hash-3.1.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 968bb8002ee839a9c65f549313df2369d88c2cbc17fa0f832870fa3b02037b9d |
|
MD5 | e1901d3fae3c12fd495b6fc96b7b4224 |
|
BLAKE2b-256 | d1d3bff3602850e98b7c632cd30d60ad6675ff2cbada501474c91d6112a0059b |
Close
Hashes for jump_consistent_hash-3.1.1-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46eeadf2fe9309bf709cbc3403584faad2ffbee00911ec377362395f0e10cd42 |
|
MD5 | 3b3eba4935d559b893946639e58de2fd |
|
BLAKE2b-256 | ea71e58b34bd2792bb2f91a8ef979815325b5f6ae9c1f8e60fbfa5a6ffe14043 |
Close
Hashes for jump_consistent_hash-3.1.1-cp36-cp36m-macosx_10_13_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e8ffc5af8fabf489ce71ea54cdf3403ba1e23a0a0c6487a444f70affdfc265c |
|
MD5 | a6d64debb614940be632823edacc4e70 |
|
BLAKE2b-256 | a491e8b019349cd83945e3207c03341a2664227dab9d8d3a158835285bf5d73d |
Close
Hashes for jump_consistent_hash-3.1.1-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a8048b9c5871e209a85c1d7dacaaa82b4dc090ef6b3add0699030d0f581db90 |
|
MD5 | 213e30a022acd5912b2d5007d654b74c |
|
BLAKE2b-256 | cec77facef45e985ec777204b59786b40dfcb3bd97bf3c2c6dd667c5b6279c1b |
Close
Hashes for jump_consistent_hash-3.1.1-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74a98e7ecdfd94951325cd7b05bb1e0359ca9493055767cf6251f8303f7a5d2d |
|
MD5 | 17e3ca65dfc5970d14276ae0d8ed972d |
|
BLAKE2b-256 | 4ad685cecdc08f9cffc533ecdec447d579899253e50c1aae1029814b378d701a |
Close
Hashes for jump_consistent_hash-3.1.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5fa2d17139e2492e0a207ab63f09eaf6ca5f77f536b762e9e1527422709bed0 |
|
MD5 | 05e5aa373ed4ba85168143a54cf32543 |
|
BLAKE2b-256 | 3c680f4be1d668873d7e9a49f58e6d6c43cd9de9f39dd5832c9fdaff7c3a0e4d |
Close
Hashes for jump_consistent_hash-3.1.1-cp35-cp35m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 748bf678b6ab09bdf6552f107b184a854a82392c982147677b21e5596f028cd0 |
|
MD5 | f507c1c1e3a2e0086ba4ab02972f15d4 |
|
BLAKE2b-256 | 2162dd3b47380a0fd6bb794a568cb5085feda0d7635d1469aff380dc2c29378f |
Close
Hashes for jump_consistent_hash-3.1.1-cp35-cp35m-macosx_10_13_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 538a8151ec70781ae7fea91fb7e0c335c80350501155a835b08fe95f95946461 |
|
MD5 | c016f25a54fe892d67846abe1287659b |
|
BLAKE2b-256 | f8cefcbb67735257af154b972db988fba08628b022f72b67e9560fc740effb51 |
Close
Hashes for jump_consistent_hash-3.1.1-cp27-cp27mu-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 762b72073f43002d14f0d058e442c7fe04780a68cc53860f74d5b6903d20537e |
|
MD5 | 7b856909e36951437675b9426521935d |
|
BLAKE2b-256 | 8581cce127b2cb84fc18a7c15d184fbdc66a4f14d526ba36b4e20f5723b81fa4 |
Close
Hashes for jump_consistent_hash-3.1.1-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ede13a3cb06954b21190d46dc156b76e336dac5439afb6e421b9ceb0e42eab9d |
|
MD5 | 90bbc38df3ceb68ded861a674f646c88 |
|
BLAKE2b-256 | 404449328099d0c7809e4ed420fee259b166da74cc6c6dd88361c8d94a00a647 |
Close
Hashes for jump_consistent_hash-3.1.1-cp27-cp27mu-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77ae6dc13bb2e4a467b515d3691b57256903475c5481a45657f1eb0322726443 |
|
MD5 | 200f4191962dab049bc754ccaa4ec618 |
|
BLAKE2b-256 | 0f3f6147f00682144e693c46b5893f276008b5494f366a45cc1dff2321206e38 |
Close
Hashes for jump_consistent_hash-3.1.1-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b52cdebc1a9f73407047096a4bd4e1849b2c2e4a15166c000e5676b9eac32f5e |
|
MD5 | 568acd427a118d99bf2856b94de76cca |
|
BLAKE2b-256 | 031d1089a6a9bf49d33aa4a89e7f0ef0ac9ff897462016b2e8e80acb649db0a2 |
Close
Hashes for jump_consistent_hash-3.1.1-cp27-cp27m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79f5ca60e245ed12b768ea4bd56766118bb9b2fe2465b44a7da2acd3c306ff24 |
|
MD5 | a0288da6a07742afbd88843d5fe52789 |
|
BLAKE2b-256 | b2787c56179084e21767784f47218c37ed1c41d41f9e47ed4b698fcb2c977101 |
Close
Hashes for jump_consistent_hash-3.1.1-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b1b1bc0124bed567dcfab5ecd1094bc7c4e83064bca0cfae7bf841a6d038716 |
|
MD5 | 34a3ec6c6a1f1fe4689dcdca94cbb3e3 |
|
BLAKE2b-256 | 34e7d1d6e46c5b32bff887234d0bf0fa43d1acff7ca00d0f32612762477229cd |
Close
Hashes for jump_consistent_hash-3.1.1-cp27-cp27m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06b5891c5bd5085d9e69fbc543b258c1c0b29e066e3a0ddcbbcf7828130ff798 |
|
MD5 | b50c3e86f64771a17e7117a0e8940f82 |
|
BLAKE2b-256 | c5fcaf24437e2a1fa11b9f855e3bf81e500243ac85fde0ff8d54d6898a2a8956 |
Close
Hashes for jump_consistent_hash-3.1.1-cp27-cp27m-macosx_10_13_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ede21b8efe64e38bc3f4e242ec6763146a8442233846ebcc39d081aaaa489237 |
|
MD5 | 0fcc0cce80efa82848fa2c1ff2462908 |
|
BLAKE2b-256 | 4910bb72f874f9682f76a0a02c8a45d8bccdfc07763c33c7ddec9ec148c10b67 |