Bitcoin Core  27.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

 field_size
 
 capacity
 
 odd_syndromes
 
 gf
 

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 pyminisketch.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 379 of file pyminisketch.py.

Member Function Documentation

◆ add()

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

Definition at line 386 of file pyminisketch.py.

Here is the call graph for this function:

◆ clone()

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

Definition at line 411 of file pyminisketch.py.

Here is the call graph for this function:

◆ 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 pyminisketch.py.

Here is the call graph for this function:

◆ deserialize()

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

Definition at line 404 of file pyminisketch.py.

Here is the call graph for this function:

◆ merge()

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

Definition at line 418 of file pyminisketch.py.

Here is the call graph for this function:

◆ serialize()

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

Definition at line 397 of file pyminisketch.py.

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 pyminisketch.py.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ capacity

pyminisketch.Minisketch.capacity

Definition at line 382 of file pyminisketch.py.

◆ field_size

pyminisketch.Minisketch.field_size

Definition at line 381 of file pyminisketch.py.

◆ gf

pyminisketch.Minisketch.gf

Definition at line 384 of file pyminisketch.py.

◆ odd_syndromes

pyminisketch.Minisketch.odd_syndromes

Definition at line 383 of file pyminisketch.py.


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