Skip to content

A generic bloom filter with parameterizable hash functions

Notifications You must be signed in to change notification settings

dejitaiza/bloomish

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Bloomish

A bloom filter in javascript. To know more about bloom filters have a look here.

Usage

A bloom filter is comprised of a set, a hashing function, a reduction function, and a membership test function.

The hash function needs to output some value to identify the items, the reduction function is used to combine the hashes of the set members, and a membership function is used to test an item's hash against the filter.

Bloomish is just the structure that ties it all together.

import Bloomish from 'bloomish';

let items = [...];

let hash = (item) => { ... };

let reduce = (acc, item) => { ... };

let has = (itemHash, filter) => { ... };

let awesomeFilter = new Bloomish({
  items,
  hash,
  reduce,
  has
});

Then it can be used as such :

var item = 'hello';

awesomeFilter.has(item);
// returns true or false

Contribution

Any contribution is welcome. Suggestions can be opened as issues, and feel free to fork the repo and open a pull request for any code contribution.

License

This software is provided as such, without any guarantees regarding it's functionality.

It is licensed under the MIT software license.

Original Author : Omar Kamali.

About

A generic bloom filter with parameterizable hash functions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published