Consistent hashing C++ Add-on for node.js

npm install hash_ring
6 downloads in the last day
110 downloads in the last week
544 downloads in the last month

node-hash-ring - Consistent Hashing C++ Add-on for node.js

See this blog post for more information.


Via npm:

npm install hash_ring

Via git:

git clone http://github.com/bnoguchi/node-hash-ring.git
cd node-hash-ring/src
node-waf configure build


var HashRing = require("./lib/hash_ring");

// Create a cluster of 3 servers weighted so that stores twice as many 
// keys as, and stores 4x as many keys as
// and 2x as many keys as
var ring = new HashRing({"": 1, "": 2, "":4});
console.log(ring.getNode("users:102") ); // Should be

See ./test/test_distribution.js for another example: node test/test_distribution.js


To run the tests:

$ make test


MIT License


Brian Noguchi

npm loves you