func IntToRune(i int) rune
IntToRune converts a digit 0 - 9 to the rune '0' - '9'. If the given int is outside of this range 'F' is returned!
func New1DCode(codeKind, content string, bars *BitList) barcode.Barcode
New1DCode creates a new 1D barcode where the bars are represented by the bits in the bars BitList
func New1DCodeIntCheckSum(codeKind, content string, bars *BitList, checksum int) barcode.BarcodeIntCS
New1DCodeIntCheckSum creates a new 1D barcode where the bars are represented by the bits in the bars BitList
func RuneToInt(r rune) int
RuneToInt converts a rune between '0' and '9' to an integer between 0 and 9 If the rune is outside of this range -1 is returned.
BitList is a list that contains bits
type BitList struct {
// contains filtered or unexported fields
}
func NewBitList(capacity int) *BitList
NewBitList returns a new BitList with the given length all bits are initialize with false
func (bl *BitList) AddBit(bits ...bool)
AddBit appends the given bits to the end of the list
func (bl *BitList) AddBits(b int, count byte)
AddBits appends the last (LSB) 'count' bits of 'b' the the end of the list
func (bl *BitList) AddByte(b byte)
AddByte appends all 8 bits of the given byte to the end of the list
func (bl *BitList) GetBit(index int) bool
GetBit returns the bit at the given index
func (bl *BitList) GetBytes() []byte
GetBytes returns all bits of the BitList as a []byte
func (bl *BitList) IterateBytes() <-chan byte
IterateBytes iterates through all bytes contained in the BitList
func (bl *BitList) Len() int
Len returns the number of contained bits
func (bl *BitList) SetBit(index int, value bool)
SetBit sets the bit at the given index to the given value
type GFPoly struct { Coefficients []int // contains filtered or unexported fields }
func NewGFPoly(field *GaloisField, coefficients []int) *GFPoly
func NewMonominalPoly(field *GaloisField, degree int, coeff int) *GFPoly
func (gp *GFPoly) AddOrSubstract(other *GFPoly) *GFPoly
func (gp *GFPoly) Degree() int
func (gp *GFPoly) Divide(other *GFPoly) (quotient *GFPoly, remainder *GFPoly)
func (gp *GFPoly) GetCoefficient(degree int) int
GetCoefficient returns the coefficient of x ^ degree
func (gp *GFPoly) MultByMonominal(degree int, coeff int) *GFPoly
func (gp *GFPoly) Multiply(other *GFPoly) *GFPoly
func (gp *GFPoly) Zero() bool
GaloisField encapsulates galois field arithmetics
type GaloisField struct { Size int Base int ALogTbl []int LogTbl []int }
func NewGaloisField(pp, fieldSize, b int) *GaloisField
NewGaloisField creates a new galois field
func (gf *GaloisField) AddOrSub(a, b int) int
AddOrSub add or substract two numbers
func (gf *GaloisField) Divide(a, b int) int
Divide divides two numbers
func (gf *GaloisField) Invers(num int) int
func (gf *GaloisField) Multiply(a, b int) int
Multiply multiplys two numbers
func (gf *GaloisField) Zero() *GFPoly
type ReedSolomonEncoder struct {
// contains filtered or unexported fields
}
func NewReedSolomonEncoder(gf *GaloisField) *ReedSolomonEncoder
func (rs *ReedSolomonEncoder) Encode(data []int, eccCount int) []int