Documentation
¶
Index ¶
- func ArByteToFile(ar []byte, name string, ext string, permissions fs.FileMode) error
- func CollectArByteFile(arByte []byte, eccsyb int) [][]byte
- func CollectArByteNotEccFile(arByte []byte) [][]byte
- func CorruptByteArray(arByte []byte, EccSymbols int) []byte
- func DecodeAndFixCorruptByteArray(arByte []byte, PrimitivePoly int, EccSymbols int) []byte
- func EncodeByteArray(arByte []byte, PrimitivePoly int, EccSymbols int) []byte
- func FileToArByte(filename string) ([]byte, error)
- func FindPrimePolys(cExponent int, fast, single bool) []int
- func GFDeduction(x, y int) int
- func GFDivision(x, y int) (int, error)
- func GFMult(x, y int) int
- func GFPolyAddition(p, q []int) (result []int)
- func GFPolyMult(p, q []int) (result []int)
- func GFPolyScale(p []int, x int) []int
- func GFPow(x, power int) int
- func PolyGen(nsym int) []int
- func RandInt(min int, max int) int
- func ReadFile(filePath string) ([]byte, string)
- func UnPackArray(decodedCollectArByte [][]int) []byte
- func WriteFile(arResultByte []byte, fileExt string, operation string)
- type RSCodec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArByteToFile ¶
func CollectArByteFile ¶
func CollectArByteNotEccFile ¶
func CorruptByteArray ¶
func DecodeAndFixCorruptByteArray ¶
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 ¶
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 FindPrimePolys ¶
FindPrimePolys computes the list of prime polynomials for the given generator and galois field characteristic exponent.
func GFPolyAddition ¶
GFPolyAddition - Polynomial addition ( добавленеи полинома )
func GFPolyMult ¶
GFPolyMult - multiply two polynomials inside Galois Field (умножение двух многочленов в поле Галуа)
func GFPolyScale ¶
gfPolyScale - multiply polynomial by scalar ( умножение полинома на скаляр )
func PolyGen ¶
PolyGen - генерация неприводимого многочлена (необходимо для кодирования сообщения по Риду-Соломону) ( Generation of an irreducible polynomial (required to encode the message according to Reed-Solomon) )
func UnPackArray ¶
UnPackArray - Unpack decodedCollectArByte into one array to create a file
( Распаковываем decodedCollectArByte в один массив для создания файла )
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 - заполняет экспоненциальные и логарифмические таблицы