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

bitcrunch

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitcrunch - npm Package Compare versions

Comparing version 0.0.0 to 0.0.1

lib/counters/bitmap.js

15

lib/bitcrunch.js

@@ -7,14 +7,23 @@

var redis = require('./redis')
, Linear = require('./counters/linear');
, BitMap = require('./counters/bitmap');
/**
* Create a counter for `key`.
*
* Note: were defaulting to `BitMap` counting for now.
*
* @public
* @param {String} key
* @return {BitMap}
*/
module.exports = function(key){
return new Linear(key);
return new BitMap(key);
};
/**
* Accessor for custom redis client.
* Accessor for setting userland redis client.
*
* @public
* @param {RedisClient} client
*/

@@ -21,0 +30,0 @@

18

lib/redis.js

@@ -9,3 +9,3 @@

/**
* Connection.
* Cached connection.
*/

@@ -16,3 +16,17 @@

/**
* Lazy getters.
* Lazy getters for getting our redis client. We
* want it to be a little lazy because the user
* has the option to set thier own redis client
* from our top level api.
*
* Example:
*
* var redis = require('redis');
* var bitcrunch = require('bitcrunch');
*
* bitcrunch.redis = redis.createClient();
*
* @private
* @param {RedisClient} other
* @return {RedisClient}
*/

@@ -19,0 +33,0 @@

{
"name": "bitcrunch",
"version": "0.0.0",
"description": "streaming cardinatility estimations",
"version": "0.0.1",
"description": "redis analytics for node",
"author": "Garrett Johnson",

@@ -6,0 +6,0 @@ "keywords": [

# bitcrunch
Probabilistic counters for node.js, backed by redis.
Redis analytics for node.js.
**Note:** *not ready for production use.*
## linear counting
## Bitmaps
Currently the only structure implemented is a linear counter. It hashes and maps input values to an internal linear identifier via `redis-identity`.
Hashes and maps input values to an internal linear identifier via [redis-identity](https://github.com/gjohnson/redis-identity). You can then ask the bitmap various questions ranging some simple membership to more complex bitwise operations.

@@ -70,7 +70,6 @@ *Basic logic*

- complex logic (and/or/and), kinda requires the promises.
- do we really need to hash values (for linear).
- max-size for linear
- linear NOT.
- linear XOR.
- more counter types (HLL, Bloom, etc).
- do we really need to hash values?.
- NOT.
- XOR.
- more counter types (Linear, HLL, Bloom, etc).

@@ -77,0 +76,0 @@ ## attribution

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