Generic interface
val create : ?error_rate:float -> int -> 'a t
create ~error_rate size
creates a fresh BF for which expected false positive rate when filled with size
elements is error_rate
.
- raises Invalid_argument
if
error_rate
is not in ]0, 1[, orsize
is negative.
val add : 'a t -> 'a -> unit
add t e
adds e
to t
.
val mem : 'a t -> 'a -> bool
mem t e
is true
if e
is in t
.
val clear : 'a t -> unit
clear t
clears the contents of t
.
val size_estimate : 'a t -> int
size_estimate t
is an approximation of the number of elements stored in the bloom filter. Please note that this operation is costly (see benchmarks).
Functorial interface
module type Hashable = sig ... end
The input interface for Bloomf.Make
.