This implements a Golomb‐coded set as defined in BIP 158. It is a compact, probabilistic data structure for testing set membership.

Synopsis

Declared in <blockfilter.h>

class GCSFilter;

Types

Name

Description

Params

Parameters controlling the SipHash keys and Golomb‐Rice encoding of a filter.

Type Aliases

Name

Description

Element

A single set element, stored as a raw byte sequence.

ElementSet

A collection of unique elements used to build or query a filter.

Member Functions

Name

Description

GCSFilter [constructor]

Constructors

GetEncoded

Returns the serialized filter contents.

GetN

Returns the number of elements in the filter.

GetParams

Returns the parameters used to build the filter.

Match

Checks if the element may be in the set. False positives are possible with probability 1/M.

MatchAny

Checks if any of the given elements may be in the set. False positives are possible with probability 1/M per element checked. This is more efficient that checking Match on multiple elements separately.

Created with MrDocs