ReedSolomonCodec
in package
Reed-Solomon codec for 8-bit characters.
Based on libfec by Phil Karn, KA9Q.
Table of Contents
- $alphaTo : SplFixedArray
- Log lookup table.
- $blockSize : int
- Block size in symbols.
- $firstRoot : int
- First root of RS code generator polynomial, index form.
- $generatorPoly : SplFixedArray
- Generator polynomial.
- $indexOf : SplFixedArray
- Anti-Log lookup table.
- $iPrimitive : int
- Prim-th root of 1, index form.
- $numRoots : int
- RS code generator polynomial degree (number of roots).
- $padding : int
- Padding bytes at front of shortened block.
- $primitive : int
- Primitive element to generate polynomial roots, index form.
- $symbolSize : int
- Symbol size in bits.
- __construct() : mixed
- decode() : int|null
- Decodes received data.
- encode() : void
- Encodes data and writes result back into parity array.
- modNn() : int
- Computes $x % GF_SIZE, where GF_SIZE is 2**GF_BITS - 1, without a slow divide.
Properties
$alphaTo
Log lookup table.
private
SplFixedArray
$alphaTo
$blockSize
Block size in symbols.
private
int
$blockSize
$firstRoot
First root of RS code generator polynomial, index form.
private
int
$firstRoot
$generatorPoly
Generator polynomial.
private
SplFixedArray
$generatorPoly
$indexOf
Anti-Log lookup table.
private
SplFixedArray
$indexOf
$iPrimitive
Prim-th root of 1, index form.
private
int
$iPrimitive
$numRoots
RS code generator polynomial degree (number of roots).
private
int
$numRoots
$padding
Padding bytes at front of shortened block.
private
int
$padding
$primitive
Primitive element to generate polynomial roots, index form.
private
int
$primitive
$symbolSize
Symbol size in bits.
private
int
$symbolSize
Methods
__construct()
public
__construct(int $symbolSize, int $gfPoly, int $firstRoot, int $primitive, int $numRoots, int $padding) : mixed
Parameters
- $symbolSize : int
- $gfPoly : int
- $firstRoot : int
- $primitive : int
- $numRoots : int
- $padding : int
Tags
Return values
mixed —decode()
Decodes received data.
public
decode(SplFixedArray $data[, SplFixedArray $erasures = null ]) : int|null
Parameters
- $data : SplFixedArray
- $erasures : SplFixedArray = null
Return values
int|null —encode()
Encodes data and writes result back into parity array.
public
encode(SplFixedArray $data, SplFixedArray $parity) : void
Parameters
- $data : SplFixedArray
- $parity : SplFixedArray
Return values
void —modNn()
Computes $x % GF_SIZE, where GF_SIZE is 2**GF_BITS - 1, without a slow divide.
private
modNn(int $x) : int
Parameters
- $x : int