Encoder

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

The encoder class is used to encode a set of symbols.

property block_bytes: int

The size of the block in bytes.

encode_symbol(coefficients: bytes) bytearray

Encode a symbol based on the given coefficients.

Parameters
coefficients – The coding coefficients that describe the encoding.
Returns
The encoded symbol.
property field: Union[Binary, Binary4, Binary8]

The chosen finite field.

is_symbol_set(index: int) bool

Check if a symbol is set.

Parameters
index – The index of the symbol.
Returns
True if the symbol set.
property rank: int

The rank of the encoding matrix, i.e., the number of symbols.

set_symbol(index: int, symbol_data: bytes)

Set a symbol.

Parameters
  • index – The index of the symbol.
  • symbol_data – The data of the symbol.
set_symbols(block_data: bytes)

Set all symbols.

Parameters
block_data – The data of the block.
property symbol_bytes: int

The size of a symbol in bytes.

symbol_data(index: int) bytes

Get the data of a symbol.

Parameters
index – The index of the symbol.
Returns
The data 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