# jump-consistent-hash

> [![CircleCI](https://circleci.com/gh/libterty/jump_consistent_hash/tree/master.svg?style=svg)](https://circleci.com/gh/libterty/jump_consistent_hash/tree/master)

Latest version **1.1.0** (published 2020-01-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install jump-consistent-hash
pnpm add jump-consistent-hash
yarn add jump-consistent-hash
bun add jump-consistent-hash
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2020-01-13 |
| First published | 2020-01-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 6.9 KB |
| Known vulnerabilities | 0 (+4 in 1 direct dependencies) |
| Install scripts | no |
| Author | 11 |
| Maintainers | lib11 |
| Keywords | consistent-hashing |

## Links

- npm: https://www.npmjs.com/package/jump-consistent-hash
- Repository: https://github.com/libterty/jump_consistent_hash
- Homepage: https://github.com/libterty/jump_consistent_hash#readme
- Issues: https://github.com/libterty/jump_consistent_hash/issues
- npm.io page: https://npm.io/package/jump-consistent-hash

## Dependencies (4)

- [chai](https://npm.io/package/chai.md) ^4.2.0
- [mocha](https://npm.io/package/mocha.md) ^7.0.0
- [sinon](https://npm.io/package/sinon.md) ^8.0.4
- [nanoid](https://npm.io/package/nanoid.md) ^2.1.9

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2020-01-13
- 1.0.0 — 2020-01-12

## README

# Jump Consistent Hash Implementation

[![CircleCI](https://circleci.com/gh/libterty/jump_consistent_hash/tree/master.svg?style=svg)](https://circleci.com/gh/libterty/jump_consistent_hash/tree/master)

- Referencing Jump Consistent Hash which can take user's Info to map a random bucket

## How to install
```
npm install jump-consistent-hash
```

## How to use
```
const { jumpConsistentHash } = require('jump-consistent-hash');
const bucket = jumpConsistentHash('0.0.0.0:1:user', 4);
```

## API
Takes a key and total of buckets

* `key` - address of info you need
* `total of buckets` - total of buckets your application has
* It can return the bucket for example as following
* '127.0.0.1:Roger1231': [
    3, 0, 1, 1,
    0, 0, 0, 1,
    2, 1
  ]
* '194.176.192.172:Albert': [
    2, 1, 1, 0,
    1, 1, 2, 1,
    2, 1
  ]
* '193.168.1.104:Willian': [
    0, 2, 3, 1,
    3, 1, 3, 1,
    2, 1
  ]
* '128.173.192.172:Lillay': [
    2, 0, 1, 1,
    3, 2, 0, 3,
    2, 2
  ]
* '0.0.0.0:Wonka': [
    2, 3, 0, 0,
    2, 0, 0, 0,
    0, 0
  ]

---
_Source: https://npm.io/package/jump-consistent-hash · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
