Skip to content

Instantly share code, notes, and snippets.

View seiflotfy's full-sized avatar

Seif Lotfy seiflotfy

View GitHub Profile
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
}