Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
seiflotfy committed Jul 26, 2015
1 parent 0b2e6ed commit b6c28ee
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,31 @@ For details about the algorithm and citations please use this article for now
["Cuckoo Filter: Better Than Bloom" by Bin Fan, Dave Andersen and Michael Kaminsky](https://www.cs.cmu.edu/~dga/papers/cuckoo-conext2014.pdf)

##Note
This implementation uses a a static bucket size of 4 fingerprints and a fingerprint size of 1 byte based on my understanding of an optimal bucket/fingerprint/size ratio from the aforementioned paper.
This implementation uses a a static bucket size of 4 fingerprints and a fingerprint size of 1 byte based on my understanding of an optimal bucket/fingerprint/size ratio from the aforementioned paper.

##Example usage:
```go

import "github.com/seiflotfy/cuckoofilter"

cf := cuckoofilter.NewDefaultCuckooFilter()
cf.InsertUnique("geeky ogre")

// Lookup a string (and it a miss) if it exists in the cuckoofilter
cf.Lookup("hello")

count := cf.GetCount()
// count == 1

// Delete a string (and it a miss)
cf.Delete("hello")

count := cf.GetCount()
// count == 1

// Delete a string (a hit)
cf.Delete("geeky ogre")

count := cf.GetCount()
// count == 0
```

0 comments on commit b6c28ee

Please sign in to comment.