Provides a simple Bloom Filter
Returns a bloom-filter object with M bits of discrimination and a set of hash functions built from the supplied MESSAGE-DIGEST-PRIMITIVE-LIST. The elements of the list of primitives may be an actual primitive object or a symbol naming the desired message-digest.
The number of hash functions, k, is not necessarily the same as the number of message-digests. A hash function is defined as returning an unsigned 32 bit integer. Most message-digests return more 32 bits of hash. The actual length of the hash is divided into 32 bit blocks to get the individual hash functions.
The argument K will restrict the actual number of hash functions to the "first" k, no matter how many more the supplied message-digests create. First in the order of MESSAGE-DIGEST-PRIMITIVE-LIST.
Selecting the optimal set of message-digests is beyond the scope of make-bloom-filter.
The current population - the number of objects added to the filter.
The number of bits of discrimination.
The number of hash functions. (See above.)
The probability of false positives for the given population size. The current population is assumed.
Add the specified OBJECT to the indicated BLOOM-FILTER.
Is the specified OBJECT in the indicated BLOOM-FILTER.
Optimal count of hash functions for the given population size N and M bits of discrimination.
Optimal count of bits of discrimination for the given population size N and K number of hash functions.
What is the probability of false positives for the population size N assuming K hash functions and M bits of discrimination.
Calculates a near-optimal number of bits of discrimination to meet the desired probability of false positives P, with the given population size N and number of hash functions K. When the k parameter is missing the bloom-filter:optimum-k procedure is used to calculate a value.
A multi-valued return of the calculated M, K, and P values. The calculated probability may be lower than the desired.
Calculates the actual number of hash functions for the MESSAGE-DIGEST-PRIMITIVE-LIST. The elements of the list of primitives may be an actual primitive object or a symbol naming the desired message-digest.
Guess.
A file, "hash-primitives-info", is located in the Chicken Repository. The file contains the information needed by bloom-filter to load hash primitives at runtime. The file is self-documenting.
Copyright (c) 2006, Kon Lovett. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ASIS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.