Property | Type | Description | |
---|---|---|---|
CalculateF | uint | ||
ComputeHash | byte[] | ||
ComputeHashSum32 | uint | ||
Contains | bool | ||
GetComponents | Components | ||
GetEmptyEntry | int | ||
IndexOf | int | ||
Insert | bool | ||
Power2 | uint |
Method | Description | |
---|---|---|
Add ( byte data ) : bool |
Will add the data to the Cuckoo Filter. It returns false if the filter is full. If the filter is full, an item is removed to make room for the new item. This introduces a possibility for false negatives. To avoid this, use Count and Capacity to check if the filter is full before adding an item.
|
|
BucketCount ( ) : uint |
Returns the number of buckets.
|
|
Capacity ( ) : uint |
Returns the number of items the filter can store.
|
|
Count ( ) : uint |
Returns the number of items in the filter.
|
|
CuckooBloomFilter ( uint n, double fpRate ) : System |
Creates a new Cuckoo Bloom filter optimized to store n items with a specified target false-positive rate.
|
|
Reset ( ) : |
Restores the Bloom filter to its original state. It returns the filter to allow for chaining.
|
|
SetHash ( |
Sets the hashing function used in the filter.
|
|
Test ( byte data ) : bool |
Will test for membership of the data and returns true if it is a member, false if not. This is a probabilistic test, meaning there is a non-zero probability of false positives.
|
|
TestAndAdd ( byte data ) : TestAndAddReturnValue |
Equivalent to calling Test followed by Add. It returns (true, false) if the data is a member, (false, add()) if not. False is returned if the filter is full. If the filter is full, an item is removed to make room for the new item. This introduces a possibility for false negatives. To avoid this, use Count and Capacity to check if the filter is full before adding an item.
|
|
TestAndRemove ( byte data ) : bool |
Will test for membership of the data and remove it from the filter if it exists. Returns true if the data was a member, false if not.
|
Method | Description | |
---|---|---|
CalculateF ( uint b, double epsilon ) : uint |
Returns the optimal fingerprint length in bytes for the given bucket size and false-positive rate epsilon.
|
|
ComputeHash ( byte data ) : byte[] |
Returns a 32-bit hash value for the given data.
|
|
ComputeHashSum32 ( byte data ) : uint |
Returns the sum of the hash.
|
|
Contains ( byte bucket, byte f ) : bool |
Indicates if the given fingerprint is contained in one of the bucket's entries.
|
|
GetComponents ( byte data ) : Components |
Returns the two hash values used to index into the buckets and the fingerprint for the given element.
|
|
GetEmptyEntry ( byte bucket ) : int |
Returns the index of the next available entry in the bucket or -1 if it's full.
|
|
IndexOf ( byte bucket, byte f ) : int |
Returns the entry index of the given fingerprint or -1 if it's not in the bucket.
|
|
Insert ( uint i1, uint i2, byte f ) : bool |
Will insert the fingerprint into the filter returning false if the filter is full.
|
|
Power2 ( uint x ) : uint |
Calculates the next power of two for the given value.
|
public CuckooBloomFilter ( uint n, double fpRate ) : System | ||
n | uint | Number of items to store |
fpRate | double | Target false-positive rate |
return | System |
public SetHash ( |
||
h | The HashAlgorithm to use. | |
return | void |
public TestAndAdd ( byte data ) : TestAndAddReturnValue | ||
data | byte | |
return | TestAndAddReturnValue |
public TestAndRemove ( byte data ) : bool | ||
data | byte | Data to test for and remove |
return | bool |