Skip to content

Commit

Permalink
fixup! drop c++ dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis committed Aug 9, 2015
1 parent 71e99c4 commit aca3d06
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 39 deletions.
9 changes: 0 additions & 9 deletions binding.gyp

This file was deleted.

11 changes: 7 additions & 4 deletions index.js
@@ -1,10 +1,13 @@
'use strict';

var hashValue = require('bindings')('hashvalue.node')
, SimpleCache = require("simple-lru-cache")
var SimpleCache = require("simple-lru-cache")
, parse = require('connection-parse')
, crypto = require('crypto');

function hashValueHash(a, b, c, d) {
return ((a << 24) | (b << 16) | (c << 8) | d) >>> 0;
}

/**
* Add a virtual node parser to the connection string parser.
*
Expand Down Expand Up @@ -134,7 +137,7 @@ HashRing.prototype.continuum = function generate() {
}

for (var j = 0; j < self.replicas; j++) {
key = hashValue.hash(x[3 + j * 4], x[2 + j * 4], x[1 + j * 4], x[j * 4]);
key = hashValueHash(x[3 + j * 4], x[2 + j * 4], x[1 + j * 4], x[j * 4]);
self.ring[index] = new Node(key, server.string);
index++;
}
Expand Down Expand Up @@ -250,7 +253,7 @@ HashRing.prototype.digest = function digest(key) {
HashRing.prototype.hashValue = function hasher(key) {
var x = this.digest(key);

return hashValue.hash(x[3], x[2], x[1], x[0]);
return hashValueHash(x[3], x[2], x[1], x[0]);
};

/**
Expand Down
2 changes: 0 additions & 2 deletions package.json
Expand Up @@ -23,9 +23,7 @@
"url": "http://github.com/3rd-Eden/node-hashring.git"
},
"dependencies": {
"bindings": "1.2.x",
"connection-parse": "0.0.x",
"nan": "2.0.x",
"simple-lru-cache": "0.0.x"
},
"devDependencies": {
Expand Down
21 changes: 0 additions & 21 deletions src/hashvalue.cc

This file was deleted.

3 changes: 0 additions & 3 deletions src/hashvalue.h

This file was deleted.

0 comments on commit aca3d06

Please sign in to comment.