Decoder

class pyerasure.Decoder(field: Union[Binary, Binary4, Binary8], symbols: int, symbol_bytes: int)

The decoder class is used to decode a set of encoded symbols.

class SymbolStatus(value)

An enumeration.

property block_bytes: int

The size of the block in bytes.

block_data() bytes

Get the data of the block.

Returns
The data of the block.
coefficients(index: int) bytearray

Get the coefficients of a symbol.

Parameters
index – The index of the symbol.
decode_symbol(symbol_data: bytearray, coefficients: bytearray)

Feed a coded symbol to the decoder.

Parameters
  • symbol – The data of the symbol assumed to be symbol_bytes() bytes in size.
  • coefficients – The coding coefficients that describe the encoding performed on the symbol.
decode_systematic_symbol(symbol_data: bytearray, index: int)

Feed a systematic, i.e, un-coded symbol to the decoder.

Parameters
  • symbol_data – The data of the symbol assumed to be symbol_bytes() bytes in size.
  • index – The index of the given symbol.
property field: Union[Binary, Binary4, Binary8]

The chosen finite field.

is_complete() bool

Check if the decoder is complete.

Returns
True if the decoder is complete.
is_symbol_decoded(index: int) bool

Check if a symbol is decoded.

Parameters
index – The index of the symbol.
Returns
True if the symbol is decoded.
is_symbol_missing(index: int) bool

Check if a symbol is missing.

Parameters
index – The index of the symbol.
Returns
True if the symbol is missing.
is_symbol_pivot(index: int) bool

Check if a symbol is a pivot symbol.

Parameters
index – The index of the symbol.
Returns
True if the symbol is a pivot symbol.
property rank: int

The rank of the decoding matrix.

recode_symbol(coefficients_in: bytes) Tuple[bytes, bytearray]

Recodes a new symbol based on given the coefficients and current state of the decoder.

Parameters
coefficients_in – These are the coding coefficients.
Returns
The recoded symbol and resulting coefficients.
property symbol_bytes: int

The size of a symbol in bytes.

symbol_data(index: int) bytearray

Get the data of a symbol.

Parameters
index – The index of the symbol.
property symbols: int

The number of symbols.

Fork me on GitHub
Versions
1.3.0
1.2.0
1.1.0
1.0.1
1.0.0
Development
latest