rendezvous-hash

1.0.1 • Public • Published

rendezvous-hash

an implementation of Rendezvous hashing (highest random weight)

Installation

npm install rendezvous-hash

Implementation

The shard weight is determined by Truncate-32(MD5(shardId + '\0' + key )), interpreted as a 32-bit little-endian integer. In a future (incompatible) release, this might be replaced by a simpler, faster hash.

API

select(key: String | Buffer, shards: { shardId: Shard } ) -> Shard

Selects a shard from the shards object based on the key and returns it.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i rendezvous-hash

Weekly Downloads

0

Version

1.0.1

License

ISC

Last publish

Collaborators

  • nathan7