0.1.2 • Published 5 years ago

cuckoo-hit-counter v0.1.2

Weekly downloads
16
License
ISC
Repository
github
Last release
5 years ago

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.

0.1.2

5 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago

1.0.4

6 years ago