Expand description
Reed-Solomon error correction for QR codes.
QR codes use Reed-Solomon codes over GF(256) to add redundancy, allowing the code to be read even when partially damaged or obscured. The error correction level (L/M/Q/H) determines how much data can be recovered:
| Level | Recovery capacity |
|---|---|
| L | ~7% |
| M | ~15% |
| Q | ~25% |
| H | ~30% |
The main entry point is construct_codewords, which takes encoded data
and produces the final data + error correction codewords ready for canvas placement.
Functions§
- construct_
codewords - Constructs data and error correction codewords ready to be put in the QR code matrix.
- create_
error_ correction_ code - Creates the error correction code in N bytes.
- max_
allowed_ errors - Computes the maximum allowed number of erratic modules can be introduced to the QR code, before the data becomes truly corrupted.