new ScalingBloomFilter(errorRateopt, optionsopt)
A scaling bloom filter (SBF) as described by Almeida et al.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
errorRate | number | <optional> | 0.1 | Max false positive probabilty | ||||||||||||||||||||
options | object | <optional> | Properties
|
- Source
Methods
add(key) → {ScalingBloomFilter}
Add item to the SBF
Parameters:
Name | Type | Description |
---|---|---|
key | string | | Item to add |
- Source
Returns:
- Type:
- ScalingBloomFilter
has(key) → {boolean}
Checks if an item probably exists in the filter
Parameters:
Name | Type | Description |
---|---|---|
key | string | | Item to check |
- Source
Returns:
- Type:
- boolean
(static) destringify(data) → {ScalingBloomFilter}
Create a ScalingBloomFilter from an object
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data | object | Properties
|
- Source
Returns:
- Type:
- ScalingBloomFilter