Documentation
¶
Overview ¶
Package rs implements Reed-Solomon error correcting codes.
The code was inspired by ZXing's Java implementation but was reduced to only support 256 values space. Source: http://code.google.com/p/zxing/
Much credit is due to Sean Owen, William Rucklidge since portions of this code are an indirect port of their Java or C++ Reed-Solomon implementations.
Parts of ZXing's implementation have been replaced by Russ Cox's gf256 library. Source: http://code.google.com/p/rsc/source/browse/#hg%2Fgf256
Index ¶
Constants ¶
This section is empty.
Variables ¶
var QRCodeField256 = NewField(0x11D, 2)
The Galois Field for QR codes. See http://research.swtch.com/field for more information.
x^8 + x^4 + x^3 + x^2 + 1
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder interface {
// Decodes given set of received codewords, which include both data and
// error-correction codewords. Really, this means it uses Reed-Solomon to
// detect and correct errors, in-place, in the input.
//
// Returns the number of errors corrected or an error if decoding failed.
Decode(data, ecc []byte) (int, error)
}
Decoder can error correct data with the corresponding ECC codes.
func NewDecoder ¶
NewDecoder creates a decoder in the defined field.
Notes ¶
Bugs ¶
It's far from complete. It can't accept total buffer size of more than 255 bytes. So len(data)+len(ecc) must be under 256 bytes.