reedosolomon

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArByteToFile

func ArByteToFile(ar []byte, name string, ext string, permissions fs.FileMode) error

func CollectArByteFile

func CollectArByteFile(arByte []byte, eccsyb int) [][]byte

func CollectArByteNotEccFile

func CollectArByteNotEccFile(arByte []byte) [][]byte

func CorruptByteArray

func CorruptByteArray(arByte []byte, EccSymbols int) []byte

func DecodeAndFixCorruptByteArray

func DecodeAndFixCorruptByteArray(arByte []byte, PrimitivePoly int, EccSymbols int) []byte

DecodeAndFixCorruptByteArray - Decoding and recovery of the file bitmap. In the first argument, we specify the polynomial used for encoding. In the second argument, we indicate the number of additional characters specified during encoding. In the third argument, we pass a multidimensional array of bits.

( Декодирование и восстановление битового массива файла. В первом аргументе указываем многочлен используемый при кодировании. Во втором аргументе указываем количество добавочных символов, указанное при кодировании. In the third argument, we pass the encoded and damaged multidimensional array. )

func EncodeByteArray

func EncodeByteArray(arByte []byte, PrimitivePoly int, EccSymbols int) []byte

EncodeByteArray - Кодирование и повреждение битового массива файла. В первом аргументе указываем один из двух примитивных многочленов в десятичном представлении (285 или 301). Во втором аргументе указываем количество добавочных символов, оно равно в двое больше количества предполагаемых ошибок. В третьем аргументе передаем многомерный массив байт.

( File bitmap encoding and corruption. In the first argument, we specify one of the two primitive polynomials in decimal notation (285 or 301). In the second argument, we specify the number of additional characters, it is equal to two more than the number of expected errors. The third argument is a multidimensional byte array. )

func FileToArByte

func FileToArByte(filename string) ([]byte, error)

func FindPrimePolys

func FindPrimePolys(cExponent int, fast, single bool) []int

FindPrimePolys computes the list of prime polynomials for the given generator and galois field characteristic exponent.

func GFDeduction

func GFDeduction(x, y int) int

GFDeduction - Deduction GF ( Вичитание GF )

func GFDivision

func GFDivision(x, y int) (int, error)

GFDivision - Division GF ( Деление GF )

func GFMult

func GFMult(x, y int) int

GFMult - Multiplication GF ( Умножение GF )

func GFPolyAddition

func GFPolyAddition(p, q []int) (result []int)

GFPolyAddition - Polynomial addition ( добавленеи полинома )

func GFPolyMult

func GFPolyMult(p, q []int) (result []int)

GFPolyMult - multiply two polynomials inside Galois Field (умножение двух многочленов в поле Галуа)

func GFPolyScale

func GFPolyScale(p []int, x int) []int

gfPolyScale - multiply polynomial by scalar ( умножение полинома на скаляр )

func GFPow

func GFPow(x, power int) int

GFPow - Modular division GF ( Деление по модулю GF )

func PolyGen

func PolyGen(nsym int) []int

PolyGen - генерация неприводимого многочлена (необходимо для кодирования сообщения по Риду-Соломону) ( Generation of an irreducible polynomial (required to encode the message according to Reed-Solomon) )

func RandInt

func RandInt(min int, max int) int

func ReadFile

func ReadFile(filePath string) ([]byte, string)

func UnPackArray

func UnPackArray(decodedCollectArByte [][]int) []byte

UnPackArray - Unpack decodedCollectArByte into one array to create a file

( Распаковываем decodedCollectArByte в один массив для создания файла )

func WriteFile

func WriteFile(arResultByte []byte, fileExt string, operation string)

Types

type RSCodec

type RSCodec struct {
	// PrimitivePoly - Десятичное представление примитивного полинома для создания таблицы поиска
	// ( Decimal representation of primitive polynomial to create lookup table )
	PrimitivePoly int
	// EccSymbols - Количество дополнительных символов
	// ( Number of additional characters )
	EccSymbols int
}

RSCodec - Кодер-декодер Рида-Соломона ( Reed-Solomon coder/decoder )

func (*RSCodec) InitTables

func (rs *RSCodec) InitTables()

InitTables - заполняет экспоненциальные и логарифмические таблицы

func (*RSCodec) RSDecode

func (rs *RSCodec) RSDecode(arStart []int) ([]int, []int)

RSDecode - декодирование и коррекция ошибок в сообщении ( decoding and error correction in a message )

func (*RSCodec) RSEncode

func (rs *RSCodec) RSEncode(arByte []byte) (encoded []int)

RSEncode - кодируем данное сообщение кодом Рида-Соломона ( encode this message with the Reed-Solomon code )

Jump to

Keyboard shortcuts

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