Documentation ¶
Overview ¶
Package gf256 implements arithmetic over the Galois Field GF(256).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
A Field represents an instance of GF(256) defined by a specific polynomial.
func NewField ¶
NewField returns a new field corresponding to the polynomial poly and generator α. The Reed-Solomon encoding in QR codes uses polynomial 0x11d with generator 2.
The choice of generator α only affects the Exp and Log operations.
func (*Field) Inv ¶
Inv returns the multiplicative inverse of x in the field. If x == 0, Inv returns 0.
type RSEncoder ¶
type RSEncoder struct {
// contains filtered or unexported fields
}
An RSEncoder implements Reed-Solomon encoding over a given field using a given number of error correction bytes.
func NewRSEncoder ¶
NewRSEncoder returns a new Reed-Solomon encoder over the given field and number of error correction bytes.