universal encoder/decoder reedosolomon
This library is a universal file encoder and decoder using Ridosolomon codes with error correction
It remembers which directories you use most frequently, so you can "jump" to
them in just a few keystrokes.
zoxide works on all major shells.
Getting started •
Installation •
Configuration •
Integrations
Use as compiled file
Step 1: Clone repo
git clone https://github.com/mellanyx/reedosolomon.git
Step 2: Build project
Let's go to the cloned project and execute the following command:
go build
After that the compiled file will appear
Step 3: Applications
Encode file
./reedosolomon encode [file path] [primitive poligon 285 / 301] [eccsybmols]
Number of bugs to be fixed = eccsybmols * 2
For example, if we specify eccsybmols equal to 2, then the maximum number of errors that we can fix will be 4.
Corrupt file
./reedosolomon corrupt [file path] [eccsybmols]
eccsybmols - we specify the same value as when encoding. After execution, the program itself will damage every 256 bits with the number of errors equal to (eccsybmols / 2)
Decode file
./reedosolomon decode [file path] [primitive poligon 285 / 301] [eccsybmols]
primitive poligon - we specify the same value as when encoding.
eccsybmols - we specify the same value as when encoding and corrupt.
After execution, we should get our original fully working file
Use as a library
Step 1: Import in your project
package main
import "github.com/mellanyx/reedosolomon/functions"
Step 2: Usage
Encode file
primitive = 285 and 301
Number of bugs to be fixed = eccsybmols * 2
For example, if we specify eccsybmols equal to 2, then the maximum number of errors that we can fix will be 4.
reedosolomon.EncodeFile(filepath, primitive, eccsymbols)
Corrupt file
eccsybmols - we specify the same value as when encoding. After execution, the program itself will damage every 256 bits with the number of errors equal to (eccsybmols / 2)
reedosolomon.CorruptFile(filepath, eccsymbols)
Decode file
reedosolomon.DecodeAndFixCorruptFile(flag.Args()[1], primitive, eccsymbols)
primitive poligon - we specify the same value as when encoding.
eccsybmols - we specify the same value as when encoding and corrupt.
After execution, we should get our original fully working file
Testing on a 1GB file
Tested on MacBook Air 2020:
- Chip: Apple M1
- Shared memory: 16 GB
- SSD: 512 GB
Encode 1GB file
Corrupt & Decode 1GB file
Result outputs
Authors
License
This project is licensed under the MIT License.