reedosolomon

command module
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: 5 Imported by: 0

README

universal encoder/decoder reedosolomon

GitHub all releases

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 startedInstallationConfigurationIntegrations

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.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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