1.0.0 • Published 5 years ago

eth-bloomfilter v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

eth-bloomfilter

Javascript implementation of the Ethereum bloom filter

npm install eth-bloomfilter

Usage

const EBF = require('eth-bloomfilter')

const filter = new EBF()

filter.add(Buffer.from('hi'))
filter.has(Buffer.from('hi'))

API

filter = new EBF()

Make a new bloom filter.

filter.buffer

The underlying 256 byte buffer containing the filter

filter.add(buf)

Add a buffer to the filter

bool = filter.has(buf)

Check if a buffer is in the filter

License

MIT