bloomf
This package implements a bloom filter for a general type of usage. It uses FNV and a simple trick to compute the k hashes required.
features
- Initializing Bloom Filter requires only the size of the filter and the number of hashing functions.
- Usage of Uint8Array TypedArray to ensure minimal memory footprint.
- Usage of bit operation to operate on our bit set implies better performance (to be test thouroughtly).
- FNV hash and simple linear hash used as hashing functions.
- Possibility to insert different element types (Number, String) by converting them into strings.
Usage
const BloomFilter = ; const filterSize = 10;const kHashes = 3; const bl = filterSize kHashes; bl;bl; bl // returns truebl // returns true
Improvements
- Use better hashing functions than the linear hashing function
- offer multiple constructors
- Check how feasable it is to transform any object into bytes in JavaScript