Skip to main content

Module ec

Module ec 

Source
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:

LevelRecovery 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.