DEFAULT_SAVE_FREQUENCY
DEFAULT_SAVE_FREQUENCY
If not specified in the constructor, this will be the number of operations between saves
Code used to manage a bloom filter in-memory and in file.
A Bloom filter is used to store a set of objects. It can support inserts into the set and it can also be used to check membership in the set.
__construct(string $fname, integer $num_values, integer $save_frequency = self::DEFAULT_SAVE_FREQUENCY)
Initializes the fields of the BloomFilter and its base PersistentStructure.
string | $fname | name of the file to store the BloomFilter data in |
integer | $num_values | the maximum number of values that will be stored in the BloomFilter. Filter will be sized so the odds of a false positive are roughly one over this value |
integer | $save_frequency | how often to store the BloomFilter to disk |
getHashBitPositionArray(string $value, integer $num_keys) : integer
Hashes $value to a bit position in the BloomFilter
string | $value | value to map to a bit position in the filter |
integer | $num_keys | number of bit positions in the Bloom filter used to say an item isin the filter |
the bit position mapped to