View Source QRCode.GaloisField (QRCode v3.1.0)

Galios Field GF(256) functions.

Summary

Functions

Add two alpha values in GF(256).

Given integer returns alpha exponent. Example

Given alpha exponent returns integer. Example

Types

@type alpha() :: 0..254
@type value() :: 1..255

Functions

@spec add(alpha(), alpha()) :: alpha()

Add two alpha values in GF(256).

Example

iex> QRCode.GaloisField.add(10, 251)
6

iex> QRCode.GaloisField.add(10, 13)
23
@spec to_a(value()) :: alpha()

Given integer returns alpha exponent. Example:

iex> QRCode.GaloisField.to_a(2)
1
@spec to_i(alpha()) :: value()

Given alpha exponent returns integer. Example:

iex> QRCode.GaloisField.to_i(1)
2