{"id":19494693,"url":"https://github.com/ceejbot/jumphash","last_synced_at":"2025-06-24T04:36:43.295Z","repository":{"id":28769263,"uuid":"32291652","full_name":"ceejbot/jumphash","owner":"ceejbot","description":"Really remarkably trivial node bindings for Google's jump consistent hash.","archived":false,"fork":false,"pushed_at":"2017-07-25T04:41:07.000Z","size":25,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-20T13:33:48.372Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ceejbot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-16T00:18:03.000Z","updated_at":"2022-01-10T09:35:25.000Z","dependencies_parsed_at":"2022-09-04T22:10:42.837Z","dependency_job_id":null,"html_url":"https://github.com/ceejbot/jumphash","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/ceejbot/jumphash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceejbot%2Fjumphash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceejbot%2Fjumphash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceejbot%2Fjumphash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceejbot%2Fjumphash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ceejbot","download_url":"https://codeload.github.com/ceejbot/jumphash/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceejbot%2Fjumphash/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261605412,"owners_count":23183814,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T21:32:10.755Z","updated_at":"2025-06-24T04:36:43.277Z","avatar_url":"https://github.com/ceejbot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @ceejbot/jumphash\n\nReally remarkably trivial node bindings for Google's [jump consistent hash](http://arxiv.org/pdf/1406.2294v1.pdf).\n\n[![Build Status](http://img.shields.io/travis/ceejbot/jumphash/master.svg?style=flat)](http://travis-ci.org/ceejbot/jumphash) [![on npm](http://img.shields.io/npm/v/@ceejbot/jumphash.svg?style=flat)](https://www.npmjs.com/package/@ceejbot/jumphash)\n\nTested on nodes 4, 6, and 7. Is probably just fine on node 0.10 too.\n\n```\nnpm install --save @ceejbot/jumphash\n```\n\n## Usage\n\nThis module provides one function: `jumphash(key, bucketCount)`. `key` must be a non-negative integer or a buffer. `bucketCount` must be a positive integer (0 is an invalid bucket count).\n\nThe return value is a integer in the range `[0, bucketCount)` that you can use as you wish. The paper linked above describes the intended data storage use.\n\n```javascript\nvar jumphash = require('@ceejbot/jumphash')\n    assert = require('assert'),\n    crypto = require('crypto');\n\nvar location = jumphash(23102, 16);\nassert(location \u003e= 0);\nassert(location \u003c 16);\n\nvar buffer = crypto\n    .createHash('md5')\n    .update('my-string-key-for-some-resource')\n    .digest();\nvar location2 = jumphash(buffer, 16);\n```\n\nOnly the first 64 bits of the buffer are considered, with the most significant bit first.\n\n## License\n\nISC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceejbot%2Fjumphash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fceejbot%2Fjumphash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceejbot%2Fjumphash/lists"}