Bitcoin Core 28.99.0
P2P Digital Currency
|
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 | |
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.
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.
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.
def pyminisketch.Minisketch.clone | ( | self | ) |
Return a clone of this sketch.
Definition at line 411 of file pyminisketch.py.
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.
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.
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.
def pyminisketch.Minisketch.serialize | ( | self | ) |
Serialize this sketch to bytes.
Definition at line 397 of file pyminisketch.py.
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.
pyminisketch.Minisketch.capacity |
Definition at line 382 of file pyminisketch.py.
pyminisketch.Minisketch.field_size |
Definition at line 381 of file pyminisketch.py.
pyminisketch.Minisketch.gf |
Definition at line 384 of file pyminisketch.py.
pyminisketch.Minisketch.odd_syndromes |
Definition at line 383 of file pyminisketch.py.