Skip to content

Bloom

A simple Bloom filter implementation originally from ethereumjs

Constructors

new Bloom()

new Bloom(bitvector?): Bloom

Represents a Bloom filter.

Parameters

bitvector?: Uint8Array

Returns

Bloom

Throws

If the byte size of the bitvector is not 256.

Defined in

packages/utils/src/Bloom.ts:21

Properties

bitvector

bitvector: Uint8Array

Defined in

packages/utils/src/Bloom.ts:15

Methods

add()

add(e): void

Adds an element to a bit vector of a 64 byte bloom filter.

Parameters

e: Uint8Array

The element to add

Returns

void

Throws

Defined in

packages/utils/src/Bloom.ts:35


check()

check(e): boolean

Checks if an element is in the bloom.

Parameters

e: Uint8Array

The element to check

Returns

boolean

Throws

Defined in

packages/utils/src/Bloom.ts:58


multiCheck()

multiCheck(topics): boolean

Checks if multiple topics are in a bloom.

Parameters

topics: Uint8Array[]

Returns

boolean

true if every topic is in the bloom

Throws

Defined in

packages/utils/src/Bloom.ts:83


or()

or(bloom): void

Bitwise or blooms together.

Parameters

bloom: Bloom

Returns

void

Throws

Defined in

packages/utils/src/Bloom.ts:91