Apex › Data & encoding
How a QR code is built (Reed-Solomon + masking)
A QR code is a little error-corrected data packet drawn as a grid. Build a real Version-1 (21×21) code end to end: the finder patterns a scanner locks onto, numeric data packed into codewords, Reed-Solomon ECC over GF(256) (why a torn or logo-covered code still reads), the zig-zag bit placement, and the mask chosen by a penalty score to keep the grid readable. The generator is verified in node against the ISO/IEC 18004 Annex-I example — data codewords 10 20 0C 56 61 80…, ECC A5 24 D4 C1 ED 36 C7 87 2C 55, all ten RS syndromes zero — and the component decodes its own matrix back to the digits (reading the mask from the format strip), an in-UI round-trip. Type your own digits and watch every layer recompute.
More in Data & encoding
- Encoding
- How a computer stores a fraction (IEEE-754)
- Why encoders use Gray code (one bit at a time)
- Varint & zigzag
- Base58 & Base58Check
- Line coding
- LZ77 compression
- LZW compression
- Burrows-Wheeler
- How genomes are assembled (de Bruijn graphs)
- Move-to-front
- Content-defined chunking
- rsync (delta sync)
- Finite automata (DFA)
- Huffman coding
- How JPEG compresses an image
- How content-aware resize works (seam carving)
- How video inter-frame compression works
- How MP3 shrinks audio (psychoacoustic masking)
- How dithering fakes gray with black & white
- Why 128 isn’t half-bright (gamma)
- Why RGB blends look muddy (OKLab)
- How HDR fits the sun on your screen (tone-mapping)
- Golomb-Rice coding
- Elias γ/δ coding
- Gorilla (time-series)
- COBS (byte stuffing)
- Arithmetic coding
- CRC-32 walk
- Hamming(7,4) code
- Reed-Solomon
- Viterbi / convolutional
- Error control
- How a barcode works (UPC check digit)