• Stars
    star
    100
  • Rank 330,625 (Top 7 %)
  • Language
    C++
  • License
    MIT License
  • Created over 8 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Reed Solomon BCH encoder and decoder

Reed-Solomon

Reed Solomon BCH encoder and decoder library

Overview

This RS implementation was designed for embedded purposes, so all the memory allocations performed on the stack.
If somebody wants to reimplement memory management with heap usage, pull requests are welcome

Getting the source

If you want only Reed-Solomon code, just clone repository.
If you want to get tests and examples also, do

git clone --recursive [email protected]:mersinvald/Reed-Solomon.git

Build

There is no need in building RS library, cause all the implementation is in headers.
To build tests and examples simply run make in the folder with cloned repo and executables will emerge in the ./build folder

Usage

All the Reed-Solomon code is in folder include, you just need to include header rs.hpp

Template class ReedSolomon accepts two template arguments: message length and ecc length.
Simple example:

    char message[] = "Some very important message ought to be delivered";
    const int msglen = sizeof(message);
    const int ecclen = 8;
    
    char repaired[msglen];
    char encoded[msglen + ecclen];


    RS::ReedSolomon<msglen, ecclen> rs;

    rs.Encode(message, encoded);

    // Corrupting first 8 bytes of message (any 4 bytes can be repaired, no more)
    for(uint i = 0; i < ecclen / 2; i++) {
        encoded[i] = 'E';
    }

    rs.Decode(encoded, repaired);

    std::cout << "Original:  " << message  << std::endl;
    std::cout << "Corrupted: " << encoded  << std::endl;
    std::cout << "Repaired:  " << repaired << std::endl;

    std::cout << ((memcmp(message, repaired, msglen) == 0) ? "SUCCESS" : "FAILURE") << std::endl;

Regards

Huge thanks to authors of wikiversity page about Reed-Solomon BCH

Related projects

Arduino Reed-Solomon Forward Error Correction library

More Repositories

1

aquamarine

Inline diagrams for rustdoc with mermaid.js
Rust
478
star
2

reed-solomon-rs

Reed-Solomon BCH encoder and decoder with support of no_std environment
Rust
26
star
3

batch_resolve

Fast asynchronous DNS batch resolver
Rust
26
star
4

tdjson-rs

TDLIB Json Client for Rust
Rust
12
star
5

rust_shm_ipc

An example implementatation of synchronized queue for inter-process communication in shared memory
Rust
10
star
6

tdjson-sys

TDLIB Json Client Rust FFI Bindings
Rust
9
star
7

rustyrobot

Rust
8
star
8

maze-generator_offscreen

Offscreen maze generator. Alternated renderer of labyrinth to OSMesa and cleaned code.
Groff
7
star
9

disciplinator

A motivation tool to reduce sedentary lifestyle health implications
Rust
3
star
10

maze-generator

Labyrinth generator and solver implemented in C/OpenGL
C
3
star
11

primitive-map-rs

[WIP] Blazing fast [Integer -> T: Clone] Map crate
Rust
3
star
12

rustylang

Rust
3
star
13

autorand-rs

Automatic random generation for any struct or enum. Make your fuzzing easier!
Rust
3
star
14

akkadia

The most extensible Language Server
Rust
2
star
15

backontime

Cross-platform filesystem notification aware backup trigger tool
Rust
2
star
16

pizip

Rust
2
star
17

try-block-rs

Macro that makes it simple to make error-catching blocks
Rust
2
star
18

disciplinator-android-app

[DEPRECATED] An android app to display the information from Disciplinator Headmaster
Java
1
star
19

htoi

just a lazy time "rewrite it in rust" game I played with my friend
Rust
1
star
20

DynamicCaller

Caller class allowing to call C++ functions by name.
C++
1
star
21

redstone

Rust
1
star
22

dist2steps

Distance to Steps fitness conversion tool
Rust
1
star
23

rust_plugin_test

Statically linked / dynamically configured plugins test with Rust
Rust
1
star
24

autolog-rs

Inner custom attribute for automated trace logging and time measurements
Rust
1
star
25

example-tokio-cpupool

Rust
1
star
26

libVK

VK API wrapper for C++11
C++
1
star
27

todo

Every developer must once write his own ToDo List. Now in Rust.
Rust
1
star
28

dotfiles

My .dotfiles w/ dotter templates
Shell
1
star
29

rust-vs-haskell-special-olimpiade

Rust
1
star
30

example-useless-proc-macro

Rust
1
star
31

moonlander

My moonlander layout, heavily inspired by github.com/optozorax/moonlander
C
1
star