Bitcoin Core  22.99.0
P2P Digital Currency
Public Member Functions | Public Attributes | List of all members
pyminisketch.Minisketch Class Reference

Public Member Functions

def __init__ (self, field_size, capacity)
def add (self, element)
def serialized_size (self)
def serialize (self)
def deserialize (self, byte_data)
def clone (self)
def merge (self, other)
def decode (self, max_count=None)

Public Attributes


Detailed Description

A Minisketch sketch.

This represents a sketch of a certain capacity, with elements of a certain bit size.

Definition at line 373 of file

Constructor & Destructor Documentation

◆ __init__()

def pyminisketch.Minisketch.__init__ (   self,
Initialize an empty sketch with the specified field_size size and capacity.

Definition at line 379 of file

Member Function Documentation

◆ add()

def pyminisketch.Minisketch.add (   self,
Add an element to this sketch. 1 <= element < 2**field_size.

Definition at line 386 of file

◆ clone()

def pyminisketch.Minisketch.clone (   self)
Return a clone of this sketch.

Definition at line 411 of file

◆ decode()

def pyminisketch.Minisketch.decode (   self,
  max_count = None 
Decode the contents of this sketch.

Returns either a list of elements or None if undecodable.

Definition at line 425 of file

Here is the call graph for this function:

◆ deserialize()

def pyminisketch.Minisketch.deserialize (   self,
Deserialize a byte array into this sketch, overwriting its contents.

Definition at line 404 of file

Here is the call graph for this function:

◆ merge()

def pyminisketch.Minisketch.merge (   self,
Merge a sketch with another sketch. Corresponds to XOR'ing their serializations.

Definition at line 418 of file

◆ serialize()

def pyminisketch.Minisketch.serialize (   self)
Serialize this sketch to bytes.

Definition at line 397 of file

Here is the call graph for this function:

◆ serialized_size()

def pyminisketch.Minisketch.serialized_size (   self)
Compute how many bytes a serialization of this sketch will be in size.

Definition at line 393 of file

Here is the caller graph for this function:

Member Data Documentation

◆ capacity


Definition at line 382 of file

◆ field_size


Definition at line 381 of file

◆ gf

Definition at line 384 of file

◆ odd_syndromes


Definition at line 383 of file

The documentation for this class was generated from the following file: