{"_id":"@subspace/jump-consistent-hash","_rev":"8-b4e76a2defa0804a02f309db8e268c84","name":"@subspace/jump-consistent-hash","dist-tags":{"latest":"1.1.1"},"versions":{"0.0.1":{"name":"@subspace/jump-consistent-hash","description":"Jump comsistent hash implementation in TypeScript","keywords":["jump","consistent","hashing"],"version":"0.0.1","homepage":"https://github.com/subspace/jump-consistent-hash","author":{"name":"Nazar Mokrynskyi","email":"nazar@mokrynskyi.com"},"license":"MIT","scripts":{"build":"rm -rf dist/* && npm run lint && npm run compile","compile":"tsc","lint":"tslint --project .","test":"npm run lint && ts-node node_modules/.bin/tape tests/**/*.ts"},"repository":{"type":"git","url":"git://github.com/subspace/jump-consistent-hash.git"},"main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/long":"^4.0.0","long":"^4.0.0","tslint":"^5.11.0","typescript":"^3.0.3"},"devDependencies":{"@types/tape":"^4.2.32","tape":"^4.9.1","ts-node":"^7.0.1"},"gitHead":"da2f8998dc70276933a49eef4eb423413633487e","bugs":{"url":"https://github.com/subspace/jump-consistent-hash/issues"},"_id":"@subspace/jump-consistent-hash@0.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.10.0","_npmUser":{"name":"rg3l3dr","email":"jeremiah.wagstaff@gmail.com"},"dist":{"integrity":"sha512-AObLi5pSsEgBt4X0fZF6nTRQ5B1L1dILuxhE1RGAijn5pqQGKPcX3kIN+557UeYSC5tIKXXiF5/AzR8hsW6UWg==","shasum":"8b51f37ee48018b0f0be9e835ce32b03c78043f9","tarball":"https://registry.npmjs.org/@subspace/jump-consistent-hash/-/jump-consistent-hash-0.0.1.tgz","fileCount":5,"unpackedSize":3986,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcrUI5CRA9TVsSAnZWagAA31oP/RdGdJUw8H5d48SjRqpp\nyzw5T2hmgpX9ttU586RRA7IkAdWcP3q4ytcGMIVrKaKOzldFOqFHKtHOc2FT\nvNmG+tMnNBEKYqAL2As8tBz6u54+RZLyHF/kFaTECybbHyc213ccDC2wDIwB\nEhcDNuPgkwaaXwPRYv2FjctEWu3cER+xfuKG/YB0eTvVZoGDneWeuHxW+Sha\nvHOlv+ddV6a8cpbh4q0+vZO8WywLoxjkEtDkoah5xsJbGonX37gPi2qHp91o\nhMN9aJAJErFIE4QUYcDWf/bUwRwM9V60STLb4uQJ4eI42XIUAmggdgvd/MnZ\niVcCa01xGfuRvOQeiE/BEdtzoO20b32781aIdsAsumb3JNyQCKQwAgMLNY0r\n3kfoNYKetTeBfsu9guhV76w6RdLnaQUKqtfOo1greYO9D9m5M/TlhD2VdqYf\na21tpymBLjcR+9ATG/h7w2G4B23A0BOII61iteBlsXPQwdnI+7Hj1Rw30Mpd\n5frI58OHcscpopbqp7PIkxuKVSKTLtYpRKX+/nNuy7yYU2U6UrrPsZJR7Tfi\nHAilWav5F1vg1lBXH7pGIY0J0g4m4BOtNLuGKbey898KyASZJ8j1AdX23g5F\nOUwUyNJM/ry0xW5BGDmFkbH7gWCoR39oBsqL14S+WmFwnIVSn2Fwhz/o+23o\ndfmT\r\n=rJwL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4y0e3mURMZSLh2K9YGjUFQm67d0+BJEHRRTH2HHC9UAIgJgQlJKlo/2WA6J3/xLXkoQLXGr17rVOQSd26ku+q3EI="}]},"maintainers":[{"name":"nazar-pc","email":"nazar@mokrynskyi.com"},{"name":"rg3l3dr","email":"jeremiah.wagstaff@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jump-consistent-hash_0.0.1_1554858552681_0.10769846775934422"},"_hasShrinkwrap":false},"1.0.0":{"name":"@subspace/jump-consistent-hash","description":"Jump consistent hash implementation in TypeScript","keywords":["jump","consistent","hashing"],"version":"1.0.0","homepage":"https://github.com/subspace/jump-consistent-hash","author":{"name":"Nazar Mokrynskyi","email":"nazar@mokrynskyi.com"},"license":"MIT","scripts":{"build":"npm run clean && npm run lint && npm run compile","clean":"rm -rf dist","compile":"tsc -b","lint":"tslint --project .","test":"npm run lint && ts-node node_modules/.bin/tape tests/**/*.ts"},"repository":{"type":"git","url":"git://github.com/subspace/jump-consistent-hash.git"},"main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"tslint":"^5.16.0","typescript":"^3.4.5"},"devDependencies":{"@types/tape":"^4.2.33","tape":"^4.10.2","ts-node":"^8.2.0"},"engineStrict":true,"engines":{"npm":">= 12.0.0"},"gitHead":"c03f81a5b28eed0b4ccd4ec665e00d7ac459e6ef","bugs":{"url":"https://github.com/subspace/jump-consistent-hash/issues"},"_id":"@subspace/jump-consistent-hash@1.0.0","_nodeVersion":"12.3.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-/fRCWq7wln5otwH2FKFQ8bMOqRrQUFwICvAaKB4LjgX/EWRxpNafzE5bMX72kD4AospfLBDeKYX9B2W5esflSA==","shasum":"c433520984baa2eec09f0d0c2defe56ce318944e","tarball":"https://registry.npmjs.org/@subspace/jump-consistent-hash/-/jump-consistent-hash-1.0.0.tgz","fileCount":5,"unpackedSize":4269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc6skFCRA9TVsSAnZWagAAMlMP/3/cxO1TaOx72U+Pimvp\nGALutSZ2cD43IfhFHZZ/cHnZiuJZk3nLyCe+ByimcWV2ps6A1VJ5mGvxM9Kr\ntF1g0I+WzJ7MeU/yYZDI/ka/NcLocTjKdav+5ouNUONLGrQh+IA0sY/YVHgs\nnPSYLSH1KTmKfxA/A3FSeS2LalPbGUvGSPQ2cl9uAOrGWDKa4MknizsHy3PW\ne+5P6a6uzjhsrcsOPueOKQ1YQ7y084qYH3R2yTIBf4l/yVfcJxfThk0qvr8c\nCjmU90F/SzA+0nH0gA1smbGw2gYNMaGoFWAg0bDo2IumrIjQT9LVBpIv9R20\nOgbCt/EXHT+/gdFM7Gn18gW2eZcqzmJOAJm2Ins3jqOa392xRb95l1P91/FA\nMXLOFnSuiwWQjgsRCV18OEbynWS+yoF5uPo3xKvBw8G7pwIfU1C1IiWLiGAp\ntMd/yye/VqRn/UmsO6ytTSjgUz1fNQ5MmfaziNSP5bjXLiS6LfAgqyWXyklL\ngLnoRsLm77l7+I+arp8B6UL+i904Jv+CmQF6dbwVeNPLgkhTXUL5vOture1t\nbe4jy/HSJYqOZgsGf1AG2MeWDWxuRkC+Gd9B1CYvu0pGNXgAQNj7geojKtHr\nQEsvZduM47uJUF/UmuTZ4VhDwL4PG70BijJnannwv6lWKDAloo4EWw+/stHn\naP41\r\n=91Xe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAvS/yavXaAQbXq/xYEUOkhQYVqDJ5cvk18SAiqX9lGxAiA/zLs9njUPTaPGOWg1ONpXKLj6SVw6xJD1w30SzPTSwA=="}]},"maintainers":[{"name":"nazar-pc","email":"nazar@mokrynskyi.com"},{"name":"rg3l3dr","email":"jeremiah.wagstaff@gmail.com"}],"_npmUser":{"name":"nazar-pc","email":"nazar@mokrynskyi.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jump-consistent-hash_1.0.0_1558890757224_0.05034376678650543"},"_hasShrinkwrap":false},"1.1.0":{"name":"@subspace/jump-consistent-hash","description":"Jump consistent hash implementation in TypeScript","keywords":["jump","consistent","hashing"],"version":"1.1.0","homepage":"https://github.com/subspace/jump-consistent-hash","author":{"name":"Nazar Mokrynskyi","email":"nazar@mokrynskyi.com"},"license":"MIT","scripts":{"build":"npm run clean && npm run lint && npm run compile","clean":"rm -rf dist","compile":"tsc -b","lint":"tslint --project .","test":"npm run lint && ts-node node_modules/.bin/tape tests/**/*.ts"},"repository":{"type":"git","url":"git://github.com/subspace/jump-consistent-hash.git"},"main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"tslint":"^5.20.0","typescript":"^3.6.3"},"devDependencies":{"@types/tape":"^4.2.33","tape":"^4.11.0","ts-node":"^8.3.0"},"engineStrict":true,"engines":{"npm":">= 12.0.0"},"gitHead":"2b5a4c756746aa49617fe5fec845483215b85fec","bugs":{"url":"https://github.com/subspace/jump-consistent-hash/issues"},"_id":"@subspace/jump-consistent-hash@1.1.0","_nodeVersion":"12.10.0","_npmVersion":"6.10.3","dist":{"integrity":"sha512-X7qZoGpoFv4qlt1VpmIQbR2OEDpLQy5P+I7yAcTiCvl5VhmzU++VTY1ZuvwBRq1pOZQNFGpyvklf3zjGrC6RVg==","shasum":"90dcdba35f1faa5789ea92a01ca398e8bdc4eb7b","tarball":"https://registry.npmjs.org/@subspace/jump-consistent-hash/-/jump-consistent-hash-1.1.0.tgz","fileCount":5,"unpackedSize":5318,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdeCuSCRA9TVsSAnZWagAAGAQP/16KOp3uHhVBSP8OqQmo\n7mbN3RrpsziVDOINu29+MWosAWJNi/CAsC3gztE3CB+guKmuTc5Q/xmgC59n\nJAi+9j+nKFxWksi2vO8ZuczLtJyqq3/7ZpJa+96c2Y3Der0ZTglpGK4tw33g\n7dHeFTxwphy3oIA+dhAIMOAxOF5Fk1ClEJRf7C2uBZBk+A135Ug0VIjapDue\nQeC2e3Eees5/Jujx7rn2pdj49f1t6xFZsmcHlvY7P5jTNuyXrR8l3H0sjoku\nvRaetFexwsctZFlGhiEZOygrFAx9wqFZG++zgIUt50ojHCUPL/i4qUXuV7EF\nMzDpjnemyfhQW+RHB3PPkC9w2GvzhnH6Fgzl+ygFqj8W/vrhas9qGTn0yqGi\nvFA2x1gGjMxCa23hnr+XLyGeXsDPc5e4OofTWcWQnrjDrgbZGuR6yaHI6MQf\nk8nvPq8x3bQGSTVlwkEbdkxcjH6NSHGDz9W7nqYfrL0cVDlJL3cNK9qrPNyB\nl42vE/gzbCkI4ioDQK/M0iIMg2Y1EQyr4KDbu9sSTXgAuLhyms8bqbTL1YAU\nCe37j0uiNlr6srU6KhCxU8cKT++vXYW2eV7ChjUzexHQmNPf4P0mD0PWF/nY\nKqCrBiU5OcD9nhPDzSaikCsslZ8gQ792xgCa7HbiOvSVACq/iYIH34kKDCWh\n0Med\r\n=gRUA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBGokEzrwHVEOLHK9DFombcsmTdTj9AeF1CPLqsg1ZvwIhAJFcjGnNMWM8O0QKujJdxpzdowjHqeyLhEXXOvAzZUQr"}]},"maintainers":[{"name":"nazar-pc","email":"nazar@mokrynskyi.com"},{"name":"rg3l3dr","email":"jeremiah.wagstaff@gmail.com"}],"_npmUser":{"name":"nazar-pc","email":"nazar@mokrynskyi.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jump-consistent-hash_1.1.0_1568156562242_0.8314061941353619"},"_hasShrinkwrap":false},"1.1.1":{"name":"@subspace/jump-consistent-hash","description":"Jump consistent hash implementation in TypeScript","keywords":["jump","consistent","hashing"],"version":"1.1.1","homepage":"https://github.com/subspace/jump-consistent-hash","author":{"name":"Nazar Mokrynskyi","email":"nazar@mokrynskyi.com"},"license":"MIT","scripts":{"build":"npm run clean && npm run lint && npm run compile","clean":"rm -rf dist","compile":"tsc -b","lint":"tslint --project .","test":"npm run lint && ts-node node_modules/.bin/tape tests/**/*.ts"},"repository":{"type":"git","url":"git://github.com/subspace/jump-consistent-hash.git"},"main":"dist/index.js","types":"dist/index.d.ts","devDependencies":{"@types/tape":"^4.2.33","tape":"^4.11.0","ts-node":"^8.3.0","tslint":"^5.20.0","typescript":"^3.6.3"},"engineStrict":true,"engines":{"npm":">= 12.0.0"},"gitHead":"b4b97e008cbe7ac62ff98e2ff213d874c37b0928","bugs":{"url":"https://github.com/subspace/jump-consistent-hash/issues"},"_id":"@subspace/jump-consistent-hash@1.1.1","_nodeVersion":"12.10.0","_npmVersion":"6.10.3","dist":{"integrity":"sha512-hYmFGAajexIfmEAQw8j+8fGgk6PPr28u0jBCHOyQne0VUHRh2sdT1HuD2zvS+o4b0r71RmF6FrNH/JbRV8Tu9Q==","shasum":"771b25adaed137375d99a9d4f57e0263a047558b","tarball":"https://registry.npmjs.org/@subspace/jump-consistent-hash/-/jump-consistent-hash-1.1.1.tgz","fileCount":5,"unpackedSize":5294,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdeXCBCRA9TVsSAnZWagAAqnEP/0R7t39FeO92XBWNFjNI\ndol74nrlniOCnjw1t//4WNRXyoMKN0cFphH+EWoLXu65MfTTaz7pRYVs3O8B\nIFY+QQ9eR2N6hDc7cW6juOzFKLVwml6MWZNuGxKRh7Ym5fNXe2T8aJN8pGcJ\nhlG60yicjjvED6DJP6Tf2WxvFdAzi/Mk1RY7YfxkBFr6OO7fjIWFfoQ4GafT\niKJaOXZOwuvcdUVbXVCYnVPhnf37TbRgm6xtZw7nim7jw8yP1XPVYoNvoByo\nyP7t9XW6Iyy/guugEIPO9asu6gbNVFUYqW3AEGWcjKNG5eWZ+i+0Itz8a/zt\n8RSSQyra4W/XTih+QI3KJY8IvCzULTAQC2N1VvB7PPL/k2n+e0kX3cu1+af/\nXcEltu9bHq9+iimcDU8pqTWYpc1uEJ9rtgGyX+ykFFJRMd9k1HZyrw0VuMhq\no7bXd36PlIgtKcNYA/+E5JgDjcmcRgN8JdYpADygADW6G4Ee4KBQeC1mH4UC\nC8amuOMvVolue0bEpMpWCTRHQsww4XNYuVACxY7uFlX38bZf9xaa3Sz3kx6r\ndUV1d1JsoaHBfFVvIBkft2jbDVnjKoKDZn3ZugC3oTSlI7QIYqaDQ3sUyp5O\ngxbI46YcY3u7OPpWXcXc9ZPeD8A2CBO48/WdTVSqyuScAmSPd7jK8yLK8CKW\n23hz\r\n=Gvp5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHkfMYRVD6Tw8OgGtYssU3xzRqaLXL4UiEysnzGHEjUFAiBG/lew4st1pO3z/Fd5KJyLgeVPmRy4hkF9qdtUNG9vNA=="}]},"maintainers":[{"email":"John@subspace.network","name":"jdolecek"},{"email":"nazar@mokrynskyi.com","name":"nazar-pc"},{"email":"jeremiah.wagstaff@gmail.com","name":"rg3l3dr"}],"_npmUser":{"name":"nazar-pc","email":"nazar@mokrynskyi.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jump-consistent-hash_1.1.1_1568239744685_0.7979001913767947"},"_hasShrinkwrap":false}},"time":{"created":"2019-04-10T01:09:12.680Z","0.0.1":"2019-04-10T01:09:12.809Z","modified":"2022-04-07T03:10:56.593Z","1.0.0":"2019-05-26T17:12:37.354Z","1.1.0":"2019-09-10T23:02:42.409Z","1.1.1":"2019-09-11T22:09:04.834Z"},"maintainers":[{"email":"serge@subspace.network","name":"subserge"},{"email":"leo@subspace.network","name":"leo_subspace"},{"email":"jeremiah.wagstaff@gmail.com","name":"rg3l3dr"},{"email":"nazar@mokrynskyi.com","name":"nazar-pc"}],"description":"Jump consistent hash implementation in TypeScript","homepage":"https://github.com/subspace/jump-consistent-hash","keywords":["jump","consistent","hashing"],"repository":{"type":"git","url":"git://github.com/subspace/jump-consistent-hash.git"},"author":{"name":"Nazar Mokrynskyi","email":"nazar@mokrynskyi.com"},"bugs":{"url":"https://github.com/subspace/jump-consistent-hash/issues"},"license":"MIT","readme":"# Jump-consistent hash implementation\nRead https://arxiv.org/abs/1406.2294 for details, this package works with 64-bit/8-byte inputs in form of `Uint8Array`s.\n\n## How to install\n```\nnpm install @subspace/jump-consistent-hash\n```\n\nNOTE: Requires Node.js v12+ or modern browser with BigInt support\n\n## How to use\nTypeScript:\n```typescript\nimport {randomBytes} from 'crypto';\nimport {jumpConsistentHash} from '@subspace/jump-consistent-hash';\n\nconst bucket = jumpConsistentHash(randomBytes(8), 10);\n```\n\n## API\n### jumpConsistentHash.jumpConsistentHash(key: Uint8Array, numBuckets: number): number\nTakes a key and number of buckets and returns bucket from range `[0, numBuckets)`.\n\n* `key` - 8 bytes key\n* `numBuckets` - number of buckets to which keys should be distributed\n","readmeFilename":"readme.md"}