Skip to content

mellanyx/reedosolomon

Repository files navigation

universal encoder/decoder reedosolomon

GitHub (Pre-)Release Date GitHub repo size

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.

Use as compiled fileUse as a libraryTesting on a 1GB file

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] [eccsybmols]

primitive poly GF(256) = one of (285, 299, 301, 333, 351, 355, 357, 361, 369, 391, 397, 425, 251, 463, 487, 501)

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 indicate a value no more than what we indicated during encoding. Once executed, the program itself will corrupt every 256 bits with an error count 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

go get https://github.com/mellanyx/reedosolomon.git
package main

import "github.com/mellanyx/reedosolomon/functions"

Step 2: Usage

Encode file

primitive poly GF(256) = one of (285, 299, 301, 333, 351, 355, 357, 361, 369, 391, 397, 425, 251, 463, 487, 501)

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 indicate a value no more than what we indicated during encoding. Once executed, the program itself will corrupt every 256 bits with an error count equal to (eccsybmols / 2)

reedosolomon.CorruptFile(filepath, eccsymbols)

Decode file

reedosolomon.DecodeAndFixCorruptFile(filepath, 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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages