reedsolomon

package
v0.0.0-...-8c0c3db Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GFPoly

type GFPoly struct {
	Coefficients []int
	// contains filtered or unexported fields
}

func NewGFPoly

func NewGFPoly(field *GaloisField, coefficients []int) *GFPoly

func NewMonominalPoly

func NewMonominalPoly(field *GaloisField, degree int, coeff int) *GFPoly

func (*GFPoly) AddOrSubstract

func (gp *GFPoly) AddOrSubstract(other *GFPoly) *GFPoly

func (*GFPoly) Degree

func (gp *GFPoly) Degree() int

func (*GFPoly) Divide

func (gp *GFPoly) Divide(other *GFPoly) (quotient *GFPoly, remainder *GFPoly)

func (*GFPoly) GetCoefficient

func (gp *GFPoly) GetCoefficient(degree int) int

GetCoefficient returns the coefficient of x ^ degree

func (*GFPoly) MultByMonominal

func (gp *GFPoly) MultByMonominal(degree int, coeff int) *GFPoly

func (*GFPoly) Multiply

func (gp *GFPoly) Multiply(other *GFPoly) *GFPoly

func (*GFPoly) Zero

func (gp *GFPoly) Zero() bool

type GaloisField

type GaloisField struct {
	Size    int
	Base    int
	ALogTbl []int
	LogTbl  []int
}

GaloisField encapsulates galois field arithmetics

func NewGaloisField

func NewGaloisField(pp, fieldSize, b int) *GaloisField

NewGaloisField creates a new galois field

func (*GaloisField) AddOrSub

func (gf *GaloisField) AddOrSub(a, b int) int

AddOrSub add or substract two numbers

func (*GaloisField) Divide

func (gf *GaloisField) Divide(a, b int) int

Divide divides two numbers

func (*GaloisField) Invers

func (gf *GaloisField) Invers(num int) int

func (*GaloisField) Multiply

func (gf *GaloisField) Multiply(a, b int) int

Multiply multiplys two numbers

func (*GaloisField) Zero

func (gf *GaloisField) Zero() *GFPoly

type ReedSolomonEncoder

type ReedSolomonEncoder struct {
	// contains filtered or unexported fields
}

func NewReedSolomonEncoder

func NewReedSolomonEncoder(gf *GaloisField) *ReedSolomonEncoder

func (*ReedSolomonEncoder) Encode

func (rs *ReedSolomonEncoder) Encode(data []int, eccCount int) []int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL