JavaReedSolomon | Backblaze Reed-Solomon Implementation in Java
kandi X-RAY | JavaReedSolomon Summary
kandi X-RAY | JavaReedSolomon Summary
This is a simple and efficient Reed-Solomon implementation in Java, which was originally built at Backblaze. There is an overview of how the algorithm works in my blog post. The ReedSolomon class does the encoding and decoding, and is supported by Matrix, which does matrix arithmetic, and Galois, which is a finite field over 8-bit values. For examples of how to use ReedSolomon, take a look at SampleEncoder and SampleDecoder. They show, in a very simple way, how to break a file into shards and encode parity, and then how to take a subset of the shards and reconstruct the original file. There is a Gradle build file to make a jar and run the tests. Running it is simple. Just type: gradle build. We would like to send out a special thanks to James Plank at the University of Tennessee at Knoxville for his useful papers on erasure coding. If you'd like an intro into how it all works, take a look at this introductory paper. This project is limited to a pure Java implementation. If you need more speed, and can handle some assembly-language programming, you may be interested in using the Intel SIMD instructions to speed up the Galois field multiplication. You can read more about that in the paper on Screaming Fast Galois Field Arithmetic.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Main method for testing
- Implementation of Gaussian elimination
- Merge this matrix into this matrix
- This method extracts data from the given shards
- Returns an array of all polynomials that can be used to generate a hash table
- Generate a logar table for a given polynomomial
- Generate a multiplication table
- Multiply two elements
- Overrides superclass implementation
- Check the given number of shards
- Code of two shards
- Code the given shard
- Returns a human - readable string representation of the matrix
- Code that runs the specified shard
- Returns a human - readable String representation of this matrix
- Code of shards
- Code of Shards
- Overrides superclass method
- Compares this matrix to another matrix
JavaReedSolomon Key Features
JavaReedSolomon Examples and Code Snippets
Community Discussions
Trending Discussions on JavaReedSolomon
QUESTION
I have implemented a simple RS error correction scheme in MATLAB with RS(160,80). The basic process is as follows:
I generate a message with length 80 and 8 bits per symbol, and I generate an RS code of length 160.
After generating the RS code, I add/XOR another Galois field of code length 160. (this field contains only 00000000 and 00000001). This is to simulate adding errors in the scheme. This generates my noisy code.
Now, I take another GF field (of a similar type as above [00000000 00000001]) which has < 40 symbols different from the one I used to create the noise. I add/XOR this to the generated noisy code in the previous step.
Finally, I run it through the RS decoder which retrieves my original message.
My MATLAB function:
...ANSWER
Answered 2017-Jul-15 at 07:17I looked at the "simple RS" example "GF28" Java code. The decoder appears to handle erasures only (one of the inputs is an array of bad indices). It's using GF(256) based on hex 11B = x^8 + x^4 + x^3 + x + 1, the same as AES encryption. It is somewhat unusual choice since the lowest "primitive" is 3 (all numbers other than zero can be considered to be a power of 3), rather than the fields where the "primitive" is 2. The field polynomial is defined via PX, so it can be easily changed. I'm not sure why it generates tables dynamically instead of generating them during initialization, using a second set of true/false tables to indicate if specific table values have been generated.
I have a C RS demo program for 8 bit GF(256) fields. It's interactive, you select a field (there are 30 of them), whether to use a self reciprocal polynomial (it's usually not used), if the first consecutive root of the generator polynomial is 1 (if no is specified, then the first consecutive root is the "primitive"), number of parity bytes, and number of data bytes. It handles both erasures and errors, and since it's a demo program, it includes code for the 3 main types of decoder algorithms Peterson matrix algorithm, Sugiyama's adaptation of extended Euclid algorithm, and Berlekamp Massey algorithm, and also Forney algorithm to generate error values. The interactive part could be replaced with code that selects all these parameters. For your situation, change the define for MAXPAR from 20 to 80 (maximum number of parities). The user input is via stdin, so a text input file can be used to run the demo.
http://rcgldr.net/misc/eccdemo8.zip
In my demo, to generate a code word, the user enters values (user option "E" or "C"), then enters "N" to encode. To generate errors, the user enters values at specific locations. To generate erasures, the user uses the "P" option to enter erasure values at specific locations. "F" is used to fix (correct) the code word.
The wiki article includes the logic for the 3 main types of decoders. It also explains the Fourier transform, but the Fourier transform requires using one of the other decoders in order to generate the error polynomial, and isn't practical.
https://en.wikipedia.org/wiki/Reed%E2%80%93Solomon_error_correction#Error_correction_algorithms
Based on your comment I looked at the Zxing library. The method descriptions are a bit terse and use the wrong terminology. Here's a redo of the description:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install JavaReedSolomon
You can use JavaReedSolomon like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the JavaReedSolomon component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page