valentinvichnal / bloomfilters.js

JavaScript bloomfilter using fastest hash algo xxHash for browsers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bloomfilters.js

bloomfilter.js - usage:

To create a filter, pass an options hash to the constructor:

initialize

var options = {
	bits: 1024,
	hashes: 7,
	seeds: [1, 2, 3, 4, 5, 6, 7]
};

filter = new BloomFilter(options);

add()

filter.add('cat');

Adds the given item to the filter. Can also accept buffers and arrays containing strings or buffers:

filter.add(['cat', 'dog', 'coati', 'red panda']);

has()

To test for membership:

filter.has('dog');

About

JavaScript bloomfilter using fastest hash algo xxHash for browsers

License:MIT License


Languages

Language:JavaScript 99.5%Language:HTML 0.5%