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

cluster-key-slot

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cluster-key-slot - npm Package Compare versions

Comparing version 1.0.12 to 1.1.0

2

lib/index.js

@@ -129,3 +129,3 @@ /*

var resultHash = 0;
var utf8 = toUTF8Array(str);
var utf8 = typeof str === 'string' ? toUTF8Array(str) : str;
var len = utf8.length;

@@ -132,0 +132,0 @@

{
"name": "cluster-key-slot",
"version": "1.0.12",
"version": "1.1.0",
"description": "Generates CRC hashes for strings - for use by node redis clients to determine key slots.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -32,2 +32,4 @@ [![Coverage Status](https://coveralls.io/repos/github/Salakar/cluster-key-slot/badge.svg?branch=master)](https://coveralls.io/github/Salakar/cluster-key-slot?branch=master)

const slot = calculateSlot('test:key:{butOnlyThis}redis');
// Buffer is also supported
const anotherSlot = calculateSlot(Buffer.from([0x7b, 0x7d, 0x2a]));

@@ -49,9 +51,13 @@ // multiple keys - multi returns a single key slot number, returns -1 if any

```text
NEW tags x 472,156 ops/sec ±1.80% (90 runs sampled)
OLD tags x 413,725 ops/sec ±1.37% (93 runs sampled)
NEW without tags x 1,287,795 ops/sec ±2.06% (89 runs sampled)
OLD without tags x 633,340 ops/sec ±0.87% (93 runs sampled)
NEW without tags singular x 4,824,560 ops/sec ±1.71% (93 runs sampled)
OLD without tags singular x 2,981,057 ops/sec ±0.22% (96 runs sampled)
node -v  ✔  16.38G RAM  10:29:07
v10.15.3
NEW tags x 721,445 ops/sec ±0.44% (90 runs sampled)
OLD tags x 566,777 ops/sec ±0.97% (96 runs sampled)
NEW without tags x 2,054,845 ops/sec ±1.77% (92 runs sampled)
OLD without tags x 865,839 ops/sec ±0.43% (96 runs sampled)
NEW without tags singular x 6,354,097 ops/sec ±1.25% (94 runs sampled)
OLD without tags singular x 4,012,250 ops/sec ±0.96% (94 runs sampled)
NEW tags (Buffer) x 552,346 ops/sec ±1.35% (92 runs sampled)
```
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