Bloom Filter
Bloom Filter
(add! filter string)
Add a string into the filter by executing the hash function and setting the corresponding bits.
Add a string into the filter by executing the hash function and setting the corresponding bits.
(bloom-filter num-bits hash-fn)
Construct a Bloom Filter with a given number of bits and a hashing function - where the hashing function takes a string and the size of the bloom filter, and returns the set of bits which the string correlates to in the filter.
See also the function `make-optimal-filter' for an easier way to construct a filter.
Construct a Bloom Filter with a given number of bits and a hashing function - where the hashing function takes a string and the size of the bloom filter, and returns the set of bits which the string correlates to in the filter. See also the function `make-optimal-filter' for an easier way to construct a filter.
(include? filter string)
Test if a string is included in the filter. The string is run through the hasing function and is indicated as being present if each of the resulting bits are set in the filter.
Test if a string is included in the filter. The string is run through the hasing function and is indicated as being present if each of the resulting bits are set in the filter.
(insertions filter)
Returns the number of insertions that have been made into the filter.
Returns the number of insertions that have been made into the filter.
(make-adler32 k)
Create `k' permuted hash functions using adler32 as the basis.
Create `k' permuted hash functions using adler32 as the basis.
(make-crc32 k)
Create `k' permuted hash functions using crc32 as the basis.
Create `k' permuted hash functions using crc32 as the basis.
(make-hash-fn-adler32 x)
Creates an adler32 hash function, with `x' as a constnat added to the hashed string.
Creates an adler32 hash function, with `x' as a constnat added to the hashed string.
(make-hash-fn-crc32 x)
Creates a crc32 hash function, with `x' as a constnat added to the hashed string.
Creates a crc32 hash function, with `x' as a constnat added to the hashed string.
(make-hash-fn-hash-code x)
Returns a function that will take a string, combine it with the constant `x' and return the hashCode of that string modulus the given bytes.
Returns a function that will take a string, combine it with the constant `x' and return the hashCode of that string modulus the given bytes.
(make-hash-fn-md5 x)
Creates an md5 hash function, with `x' as a constnat added to the hashed string.
Creates an md5 hash function, with `x' as a constnat added to the hashed string.
(make-hash-fn-sha1 x)
Creates a sha1 hash function, with `x' as a constnat added to the hashed string.
Creates a sha1 hash function, with `x' as a constnat added to the hashed string.
(make-md5 k)
Create `k' permuted hash functions using md5 as the basis.
Create `k' permuted hash functions using md5 as the basis.
(make-optimal-filter entries prob & [hash-fn])
Create an optimal filter for the estimated number of entries and desired false positive rate.
Create an optimal filter for the estimated number of entries and desired false positive rate.
(make-permuted-hash-fn base-fn values)
Given a base hash function, and a vector of values, creates a set of hash functions, one for each of the values, and returns a function that will inovke each of these permuted functions on a given string.
Given a base hash function, and a vector of values, creates a set of hash functions, one for each of the values, and returns a function that will inovke each of these permuted functions on a given string.
(make-sha1 k)
Create `k' permuted hash functions using sha1 as the basis.
Create `k' permuted hash functions using sha1 as the basis.
(num-bits-for-entries-and-fp-probability n-entries fp-prob)
Computes a Bloom Filter (bit array) size for the estimated number of entries and the desired false positive probability.
Computes a Bloom Filter (bit array) size for the estimated number of entries and the desired false positive probability.
(num-hash-fns-for-entries-and-bits n-entries m-bits)
Computes the optimialnumber of hash functions for an estimated number of entries and a given filter size.
Computes the optimialnumber of hash functions for an estimated number of entries and a given filter size.
(optimal-n-and-k entries prob)
Compute the optimal filter size (number of bits: n) and number of hashing functions (k) for the estimate number of entries to acheive the given, desired, false positive probability rate.
Compute the optimal filter size (number of bits: n) and number of hashing functions (k) for the estimate number of entries to acheive the given, desired, false positive probability rate.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close