\Zxing\Common\ReedsolomonGenericGF

<p>This class contains utility methods for performing mathematical operations over the Galois Fields. Operations use a given primitive polynomial in calculations.</p>

Throughout this package, elements of the GF are represented as an {@code int} for convenience and speed (but at the cost of memory).

Summary

Methods
Properties
Constants
__construct()
Init()
addOrSubtract()
getZero()
getOne()
buildMonomial()
exp()
log()
inverse()
multiply()
getSize()
getGeneratorBase()
toString()
$AZTEC_DATA_12
$AZTEC_DATA_10
$AZTEC_DATA_6
$AZTEC_PARAM
$QR_CODE_FIELD_256
$DATA_MATRIX_FIELD_256
$AZTEC_DATA_8
$MAXICODE_FIELD_64
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$expTable
$logTable
$zero
$one
$primitive
$size
$generatorBase
N/A

Properties

$AZTEC_DATA_12

$AZTEC_DATA_12

$AZTEC_DATA_10

$AZTEC_DATA_10

$AZTEC_DATA_6

$AZTEC_DATA_6

$AZTEC_PARAM

$AZTEC_PARAM

$QR_CODE_FIELD_256

$QR_CODE_FIELD_256

$DATA_MATRIX_FIELD_256

$DATA_MATRIX_FIELD_256

$AZTEC_DATA_8

$AZTEC_DATA_8

$MAXICODE_FIELD_64

$MAXICODE_FIELD_64

$expTable

$expTable : array

Type

array

$logTable

$logTable : array

Type

array

$zero

$zero : \Zxing\Common\Reedsolomon\GenericGFPoly

Type

GenericGFPoly

$one

$one : \Zxing\Common\Reedsolomon\GenericGFPoly

Type

GenericGFPoly

$primitive

$primitive

$size

$size

$generatorBase

$generatorBase

Methods

__construct()

__construct(\Zxing\Common\Reedsolomon\irreducible  $primitive, \Zxing\Common\Reedsolomon\the  $size, \Zxing\Common\Reedsolomon\the  $generatorBase) : mixed

Create a representation of GF(size) using the given primitive polynomial.

Parameters

\Zxing\Common\Reedsolomon\irreducible $primitive

polynomial whose coefficients are represented by the bits of an int, where the least-significant bit represents the constant coefficient

\Zxing\Common\Reedsolomon\the $size

size of the field

\Zxing\Common\Reedsolomon\the $generatorBase

factor b in the generator polynomial can be 0- or 1-based (g(x) = (x+a^b)(x+a^(b+1))...(x+a^(b+2t-1))). In most cases it should be 1, but for QR code it is 0.

Returns

mixed —

Init()

Init() : void

addOrSubtract()

addOrSubtract(mixed  $a, mixed  $b) : mixed

Implements both addition and subtraction -- they are the same in GF(size).

Parameters

mixed $a
mixed $b

Returns

mixed —

getZero()

getZero() : mixed

Returns

mixed —

getOne()

getOne() : mixed

Returns

mixed —

buildMonomial()

buildMonomial(mixed  $degree, mixed  $coefficient) : \Zxing\Common\Reedsolomon\GenericGFPoly

Parameters

mixed $degree
mixed $coefficient

Returns

\Zxing\Common\Reedsolomon\GenericGFPoly —

the monomial representing coefficient * x^degree

exp()

exp(mixed  $a) : \Zxing\Common\Reedsolomon\2

Parameters

mixed $a

Returns

\Zxing\Common\Reedsolomon\2 —

to the power of a in GF(size)

log()

log(mixed  $a) : \Zxing\Common\Reedsolomon\base

Parameters

mixed $a

Returns

\Zxing\Common\Reedsolomon\base —

2 log of a in GF(size)

inverse()

inverse(mixed  $a) : \Zxing\Common\Reedsolomon\multiplicative

Parameters

mixed $a

Returns

\Zxing\Common\Reedsolomon\multiplicative —

inverse of a

multiply()

multiply(mixed  $a, mixed  $b) : int

Parameters

mixed $a
mixed $b

Returns

int —

product of a and b in GF(size)

getSize()

getSize() : mixed

Returns

mixed —

getGeneratorBase()

getGeneratorBase() : mixed

Returns

mixed —

toString()

toString() : mixed

Returns

mixed —