qr_code v1.0.4 QRCode.GeneratorPolynomial

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).

Link to this section Summary

Functions

Returns generator polynomials in alpha exponent for given error code length. Example

Link to this section Types

Link to this type

degree()
degree() :: 1..254

Link to this type

polynomial()
polynomial() :: [QRCode.GaloisField.alpha()]

Link to this section Functions

Link to this function

create(degree)
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]