Liking cljdoc? Tell your friends :D

com.github.kyleburton.clj-bloom

Bloom Filter

Bloom Filter
raw docstring

add!clj

(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.
sourceraw docstring

bloom-filterclj

(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.
sourceraw docstring

include?clj

(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.
sourceraw docstring

insertionsclj

(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.
sourceraw docstring

make-adler32clj

(make-adler32 k)

Create `k' permuted hash functions using adler32 as the basis.

Create `k' permuted hash functions using adler32 as the basis.
sourceraw docstring

make-crc32clj

(make-crc32 k)

Create `k' permuted hash functions using crc32 as the basis.

Create `k' permuted hash functions using crc32 as the basis.
sourceraw docstring

make-hash-fn-adler32clj

(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.
sourceraw docstring

make-hash-fn-crc32clj

(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.
sourceraw docstring

make-hash-fn-hash-codeclj

(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.
sourceraw docstring

make-hash-fn-md5clj

(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.
sourceraw docstring

make-hash-fn-sha1clj

(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.
sourceraw docstring

make-md5clj

(make-md5 k)

Create `k' permuted hash functions using md5 as the basis.

Create `k' permuted hash functions using md5 as the basis.
sourceraw docstring

make-optimal-filterclj

(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.
sourceraw docstring

make-permuted-hash-fnclj

(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.
sourceraw docstring

make-sha1clj

(make-sha1 k)

Create `k' permuted hash functions using sha1 as the basis.

Create `k' permuted hash functions using sha1 as the basis.
sourceraw docstring

num-bits-for-entries-and-fp-probabilityclj

(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.
sourceraw docstring

num-hash-fns-for-entries-and-bitsclj

(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.
sourceraw docstring

optimal-n-and-kclj

(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.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close