cuckoo-filter
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "cuckoo-filter", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Cuckoo Filter: Better Than Bloom", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -18,2 +18,30 @@ #Cuckoo Filters | ||
previous data structures that extend Bloom filters to | ||
support deletions substantially in both time and space. | ||
support deletions substantially in both time and space. | ||
## Install | ||
``` | ||
npm install cuckoo-filter | ||
``` | ||
## Usage | ||
```javascript | ||
const CuckooFilter = require('cuckoo-filter').CuckooFilter | ||
const ScalableFilter = require('cuckoo-filter').ScalableCuckooFilter | ||
let cuckoo= new CuckooFilter(200, 4, 2) // (Size, Bucket Size, Finger Print Size) | ||
let cuckoo2 = new ScalableCuckooFilter(2000, 4, 2, 2) // (Size, Bucket Size, Finger Print Size, Exponential Scale) | ||
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.count) // 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. | ||
Scalable cuckoo filters scale exponentially to hold your data. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21185
47