View Source QRCode.GeneratorPolynomial (QRCode v3.1.0)
Error correction coding uses polynomial long division. To do that, two polynomials are needed. The first polynomial to use is called the message polynomial. The message polynomial uses the data codewords from the data encoding step as its coefficients. For example, if the data codewords, converted to integers, were 25, 218, and 35, the message polynomial would be 25x2 + 218x + 35. In practice, real message polynomials for standard QR codes are much longer, but this is just an example.
The message polynomial will be divided by a generator polynomial.
The generator polynomial is a polynomial that is created by multiplying
(x - a0) ... (x - a(n-1))
where n
is the number of error correction codewords
that must be generated (see the error correction table).
Summary
Functions
Returns generator polynomials in alpha exponent for given error code length. Example
Types
@type degree() :: 1..254
@type polynomial() :: [QRCode.GaloisField.alpha()]
Functions
@spec create(degree()) :: polynomial()
Returns generator polynomials in alpha exponent for given error code length. Example:
iex> QRCode.GeneratorPolynomial.create(10)
[0, 251, 67, 46, 61, 118, 70, 64, 94, 32, 45]