2.1.5 • Published 6 years ago

bloomf v2.1.5

Weekly downloads
13
License
ISC
Repository
github
Last release
6 years ago

Build Status Coverage Status License: MIT

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 = require('bloomf');

const filterSize = 10;
const kHashes = 3;

const bl = new BloomFilter(filterSize, kHashes);

bl.insert(3);
bl.insert("bloblo");

bl.test(3) // returns true
bl.test("bloblo") // 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
2.1.5

6 years ago

2.1.4

6 years ago

2.1.3

6 years ago

2.1.2

6 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.0

6 years ago

1.0.0

6 years ago