Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
pyminisketch.Minisketch Class Reference

Public Member Functions

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

Public Attributes

 field_size = field_size
 capacity = capacity
list odd_syndromes = [0] * capacity
 gf = GF2Ops(field_size)

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__()

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()

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

Definition at line 386 of file pyminisketch.py.

◆ clone()

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

Definition at line 411 of file pyminisketch.py.

◆ decode()

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()

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()

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.

◆ serialize()

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()

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 caller graph for this function:

Member Data Documentation

◆ capacity

pyminisketch.Minisketch.capacity = capacity

Definition at line 382 of file pyminisketch.py.

◆ field_size

pyminisketch.Minisketch.field_size = field_size

Definition at line 381 of file pyminisketch.py.

◆ gf

pyminisketch.Minisketch.gf = GF2Ops(field_size)

Definition at line 384 of file pyminisketch.py.

◆ odd_syndromes

pyminisketch.Minisketch.odd_syndromes = [0] * capacity

Definition at line 383 of file pyminisketch.py.


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