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

cuckoo-filter

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cuckoo-filter - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"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.
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