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

cuckoo-hit-counter

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cuckoo-hit-counter

A hit counter based on cuckoo filters

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Cuckoo Hit Counter

https://www.cs.cmu.edu/~dga/papers/cuckoo-conext2014.pdf

Rationale

Cuckoo filter are a really good means of storing set memberships for large datasets in a space efficient manner. Sometimes we don't want to just test membership but also count accesses for large datasets in a space efficient manner. This is an attempt at solving that problem. Specifically for use in The Owner Free File System where it is used in combination with the fibonacci series to determine how the network grows.

Install

npm install cuckoo-hit-counter

Usage

const CuckooHitCounter = require('cuckoo-hit-counter')

let cuckoo= new CuckooHitCounter(200, 4, 2) // (Size, Bucket Size, Finger Print Size)

console.log(cuckoo.add('Your Momma'))//(buffer|string|number) returns true if successful
console.log(cuckoo.contains('Your Momma'))// true: She's definately in there
console.log(cuckoo.rank('Your Momma'))// 0: A Fibonacci rank of 0
console.log(cuckoo.tally('Your Momma'))// 0: A Tally of 0 hits
console.log(cuckoo.number) // 1
console.log(cuckoo.remove('Your daddy'))//false He's not home
console.log(cuckoo.reliable) // true less than 95% full
let json = cuckoo.toJSON() // serialize to json object
let cbor = cuckoo.toCBOR() // serialize to cbor

Note

Size your buckets and fingerprints to avoid collisions.

FAQs

Package last updated on 24 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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