Involved Source Files Package gf256 implements arithmetic over the Galois Field GF(256).
Package-Level Type Names (total 2, both are exported)
/* sort exporteds by: | */
A Field represents an instance of GF(256) defined by a specific polynomial.exp[510]byte // log[0] is unused Add returns the sum of x and y in the field. Exp returns the base-α exponential of e in the field.
If e < 0, Exp returns 0. Inv returns the multiplicative inverse of x in the field.
If x == 0, Inv returns 0. Log returns the base-α logarithm of x in the field.
If x == 0, Log returns -1. Mul returns the product of x and y in the field.(*Field) gen(e int) (gen, lgen []byte)
func NewField(poly, α int) *Field
func NewRSEncoder(f *Field, c int) *RSEncoder
var rsc.io/qr/coding.Field *Field
An RSEncoder implements Reed-Solomon encoding
over a given field using a given number of error correction bytes.cintf*Fieldgen[]bytelgen[]bytep[]byte ECC writes to check the error correcting code bytes
for data using the given Reed-Solomon parameters.
func NewRSEncoder(f *Field, c int) *RSEncoder
Package-Level Functions (total 6, in which 2 are exported)
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.
NewRSEncoder returns a new Reed-Solomon encoder
over the given field and number of error correction bytes.
mul returns the product x*y mod poly, a GF(256) multiplication.
nbit returns the number of significant in p.
polyDiv divides the polynomial p by q and returns the remainder.
reducible reports whether p is reducible.
The pages are generated with Goldsv0.6.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.