Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hashring

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hashring - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

output.txt

18

benchmarks/benchmark.js

@@ -13,3 +13,3 @@ 'use strict';

var HashRing = require('../')
, Hash_ring = require('hash_ring')
// , Hash_ring = require('hash_ring')
, nodes = {'192.168.0.102:11212': 1, '192.168.0.103:11212': 1, '192.168.0.104:11212': 1};

@@ -25,4 +25,4 @@

*/
var ring1 = new HashRing(nodes)
, ring2 = new Hash_ring(nodes);
var ring1 = new HashRing(nodes);
//, ring2 = new Hash_ring(nodes);

@@ -36,4 +36,4 @@ /**

var r = new HashRing(nodes);
}).add('hash_ring', function(){
var r = new Hash_ring(nodes);
//}).add('hash_ring', function(){
// var r = new Hash_ring(nodes);
}).on('cycle', function cycle(e) {

@@ -59,4 +59,4 @@ var details = e.target;

ring1.get('key' + Math.random());
}).add('hash_ring', function(){
ring2.getNode('key' + Math.random());
//}).add('hash_ring', function(){
// ring2.getNode('key' + Math.random());
}).on('cycle', function cycle(e) {

@@ -82,4 +82,4 @@ var details = e.target;

ring1.get('key');
}).add('hash_ring', function(){
ring2.getNode('key');
//}).add('hash_ring', function(){
// ring2.getNode('key');
}).on('cycle', function cycle(e) {

@@ -86,0 +86,0 @@ var details = e.target;

@@ -195,3 +195,3 @@ 'use strict';

* @param {String} key
* @returns {String} hash
* @returns {String|Buffer} hash, depends on node version
* @api private

@@ -211,3 +211,9 @@ */

HashRing.prototype.digest = function digest(key) {
return this.hash(key +'').toString().split('').map(function charCode(char) {
var hash = this.hash(key +'');
// Support for Node 0.10 which returns buffers so we don't need to charAt
// lookups.
if ('string' !== typeof hash) return hash;
return hash.split('').map(function charCode(char) {
return char.charCodeAt(0);

@@ -214,0 +220,0 @@ });

{
"name": "hashring",
"version": "1.0.0",
"version": "1.0.1",
"author": "Arnout Kazemier",

@@ -5,0 +5,0 @@ "description": "A consistent hashring compatible with ketama hashing and python's hash_ring",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc