3rd-Eden / node-hashring

hashring is a consistent hashing algorithm for Node.js that is compatible with libketama and python's hash_ring package
MIT License
350 stars 61 forks source link

Update nan dependency to 2.0.x #35

Closed bnoordhuis closed 8 years ago

bnoordhuis commented 8 years ago

This is needed for compatibility with the latest io.js release(s).

@3rd-Eden Can you do a release for this? Thanks.

bnoordhuis commented 8 years ago

Hrm, this is mildly annoying. io.js v3.x needs gcc 4.8 for its C++11 support but adding that to the .travis.yml somehow makes istanbul disappear from the PATH...

bnoordhuis commented 8 years ago

Reimplemented the hash in pure JS and the CI is all green now. Seems to be slightly faster too, at least on my system.

3rd-Eden commented 8 years ago

@bnoordhuis Thanks for the pull request, but I have no idea why tests are passing as I'm pretty sure that hashing required 64 bit bit shifting in order to correctly generate a stable hashring. And that was the reason I moved to a binary addon in the first place.

bnoordhuis commented 8 years ago

The C++ code uses (unsigned) int and that's 32 bits on all platforms node runs on.

3rd-Eden commented 8 years ago

That is an excelent point lol.