ErrorCorrection
Com\Tecnick\Barcode\Type\Square\Datamatrix\ErrorCorrection
Error correction methods and other utilities for Datamatrix Barcode type class
Tags
Table of Contents
- getErrorCorrection() : array<string|int, mixed>
- Add error correction codewords to data codewords array (ANNEX E).
- genLogs() : mixed
- Generate the log ($log) and antilog ($alog) tables
- getGFProduct() : int
- Product of two numbers in a Power-of-Two Galois Field
Methods
getErrorCorrection()
Add error correction codewords to data codewords array (ANNEX E).
public getErrorCorrection(array<string|int,
mixed> $wdc,
int $nbk,
int $ncw,
int $ncc[,
int $ngf
= 256
][,
int $vpp
= 301
]) : array<string|int,
mixed>
Parameters
- $wdc : array<string|int, mixed>
-
Array of datacodewords.
- $nbk : int
-
Number of blocks.
- $ncw : int
-
Number of data codewords per block.
- $ncc : int
-
Number of correction codewords per block.
- $ngf : int = 256
-
Number of fields on log/antilog table (power of 2).
- $vpp : int = 301
-
The value of its prime modulus polynomial (301 for ECC200).
Return values
array<string|int, mixed> —data codewords + error codewords
genLogs()
Generate the log ($log) and antilog ($alog) tables
protected genLogs(array<string|int,
mixed> &$log,
arrya &$alog,
int $ngf,
int $vpp)
: mixed
Parameters
- $log : array<string|int, mixed>
-
Log table
- $alog : arrya
-
Anti-Log table
- $ngf : int
-
Number of fields on log/antilog table (power of 2).
- $vpp : int
-
The value of its prime modulus polynomial (301 for ECC200).
Return values
mixed —getGFProduct()
Product of two numbers in a Power-of-Two Galois Field
protected getGFProduct(int $numa,
int $numb,
array<string|int,
mixed> $log,
array<string|int,
mixed> $alog,
array<string|int,
mixed> $ngf)
: int
Parameters
- $numa : int
-
First number to multiply.
- $numb : int
-
Second number to multiply.
- $log : array<string|int, mixed>
-
Log table.
- $alog : array<string|int, mixed>
-
Anti-Log table.
- $ngf : array<string|int, mixed>
-
Number of Factors of the Reed-Solomon polynomial.
Return values
int —product