Search code examples
javaqr-codereed-solomon

Reed-Solomon algorithm usage in java


I'm currently working on a school project related to QR Codes generation, and i have a really huge problem with the error correction system. I found this website http://www.pclviewer.com/rs2/calculator.html, it works like a charm but it's an online tool, and i need this exact functionality ported in Java. Is there any way i can found this ? I tried the zxing class but i can't figure how to only use the Reed-Solomon part (because of course it's the only part i can use).

Thanks you all for answers, and have a good day.


Solution

  • You should use the implemenation in zxing. I know you say you couldn't figure it out, but, surely if you look at the code you see the API. It doesn't get much simpler than:

    https://code.google.com/p/zxing/source/browse/trunk/core/src/main/java/com/google/zxing/common/reedsolomon/ReedSolomonEncoder.java#52

    https://code.google.com/p/zxing/source/browse/trunk/core/src/main/java/com/google/zxing/common/reedsolomon/ReedSolomonDecoder.java#58

    You can see how these are used, even, in QR codes:

    https://code.google.com/p/zxing/source/browse/trunk/core/src/main/java/com/google/zxing/qrcode/decoder/Decoder.java#191