You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

github.com/kuba--/cuckoo

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/kuba--/cuckoo


Version published
Created

Readme

Source

GoDoc Go Report Card Build Status

Cuckoo Filter: Practically Better Than Bloom

Package cuckoo provides a Cuckoo Filter (Practically Better Than Bloom). Cuckoo filters provide the flexibility to add and remove items dynamically. A cuckoo filter is based on cuckoo hashing (and therefore named as cuckoo filter). It is essentially a cuckoo hash table storing each key's fingerprint.

Implementation is based heavily on whitepaper: "Cuckoo Filter: Better Than Bloom" by Bin Fan, Dave Andersen and Michael Kaminsky (https://www.cs.cmu.edu/~dga/papers/cuckoo-conext2014.pdf).

Example

    var item []byte

    // Create a new filter with 32MB capacity
    f := cuckoo.NewFilter(32 * 1024 * 1024)

    if f.Lookup(item) {
        if !f.Delete(item) {
            // Cannot delete the item
            // ...
        }
    } else {
        if err := f.Insert(item); err != nil {
            // Hashtable is considered full
            // ...
        }
    }

Fuzzing - randomized testing

  • get go-fuzz
    $ go get github.com/dvyukov/go-fuzz/go-fuzz
    $ go get github.com/dvyukov/go-fuzz/go-fuzz-build
  • build the test program with necessary instrumentation
    $ go-fuzz-build github.com/kuba--/cuckoo/fuzz/cuckoo
  • ready to go
    $ go-fuzz -bin=./cuckoo-fuzz.zip -workdir=/tmp/cuckoo

FAQs

Package last updated on 21 Mar 2017

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc