Created
September 28, 2018 15:12
-
-
Save arriqaaq/7b57bd6e4adcd18f382cc6114c5ea851 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (c *CuckooFilter) Lookup(data []byte) bool { | |
// f = fingerprint(x); | |
// i1 = hash(x); | |
// i2 = i1 ⊕ hash(f); | |
// if bucket[i1] or bucket[i2] has f then | |
// return True; | |
// return False; | |
i1, i2, f := c.getCuckooParams(data) | |
if c.buckets[i1].contains(f) || c.buckets[i2].contains(f) { | |
return true | |
} | |
return false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment