0.0.1 • Published 7 years ago

@mcrowe/bloom-filter v0.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
7 years ago

bloom-filter

Persistance and hash-function agnostic bloom filter for Javascript and Typescript.

Usage

npm install @mcrowe/bloom-filter --save

import {
  BloomFilter,
  BufferBackend,
  DummyHasher
} from '@mcrowe/bloom-filter'


(async function() {


  const filter = new BloomFilter({
    backend: BufferBackend,
    hasher: DummyHasher,
    numHashes: 7,
    numBits: 512
  })

  await filter.add('abc')

  if (await filter.test('abc')) {
    console.log('it works!')
  }


})()

Development

Install npm modules:

npm install

Run tests:

npm test

Release

Release a new version:

bin/release.sh

This will publish a new version to npm, as well as push a new tag up to github.