cuckoo-lookup ( bytes cuckoo-filter -- ? )


Vocabulary
cuckoo-filters

Inputs
bytesa byte-array
cuckoo-filtera cuckoo-filter


Outputs
?a boolean


Word description
Lookup the data from the cuckoo-filter, returning t if the data appears to be a member. This is a probabilistic test, meaning there is a possibility of false positives.

Definition


:: cuckoo-lookup ( bytes cuckoo-filter -- ? )
bytes cuckoo-filter hash-indices :> ( fp i1 i2 )
cuckoo-filter buckets>> :> buckets buckets length :> n {
[ fp i1 n mod buckets nth bucket-lookup ]
[ fp i2 n mod buckets nth bucket-lookup ]
} 0|| ;