Skip to content

Instantly share code, notes, and snippets.

@seiflotfy
Created June 29, 2015 03:03
Show Gist options
  • Save seiflotfy/0f3111e2e5204c1c566a to your computer and use it in GitHub Desktop.
Save seiflotfy/0f3111e2e5204c1c566a to your computer and use it in GitHub Desktop.
func (cf *CuckooFilter) getComponents(data []byte) (uint, uint, []byte) {
hash := cf.getHash(data)
f := hash[0:cf.fingerprintSize]
i1 := uint(binary.BigEndian.Uint32(hash))
i2 := i1 ^ uint(binary.BigEndian.Uint32(cf.getHash(f)))
return i1, i2, f
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment