This package has been deprecated

Author message:

This package is no longer maintained.

atbf

1.1.1 • Public • Published

atbf

Build Status

This package provides a simple attenuated bloom filter. An attenuated bloom filter is a series of bloom filters that can be used to represent items in sets over a sort of distance plot. This is useful in particular for things like Quasar where each bloom filter in the set is used to represent topics to which peers N hops aways are subscribed.

Usage

npm install atbf --save
const AttenuatedBloomFilter = require('atbf');
const atbf = new AttenuatedBloomFilter({ bitfieldSize: 160, filterDepth: 3 });
 
atbf[0].add(Buffer.from('some item'));
atbf[0].has(Buffer.from('some item')); // true
atbf[0].has(Buffer.from('other item')); // false

The AttenuatedBloomFilter object extends Array, so the usual suspects like map, forEach, etc are available.

License

GNU Lesser General Public License 3.0

Package Sidebar

Install

npm i atbf

Weekly Downloads

11

Version

1.1.1

License

LGPL-3.0

Unpacked Size

15.3 kB

Total Files

6

Last publish

Collaborators

  • npm