Handbook
Glossary
cuckoo-lookup ( bytes cuckoo-filter -- ? )
Vocabulary
cuckoo-filters
Inputs
bytes
a
byte-array
cuckoo-filter
a
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
USING:
accessors
combinators.short-circuit
cuckoo-filters.private
math
sequences
;
IN:
cuckoo-filters
::
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||
;