This repository demonstrates how a QR Code generator works internally. A minimal and readable implementation of the QR Code standard. Designed for share and understanding how QR Codes algorithm work.
This project is a simple and educational implementation of QR Code generation.
It focuses on:
- clear algorithm steps
- semantic correctness
- modular structure
- easy to read code
The goal is not performance, but understanding how QR Codes are constructed.
This implementation follows several principles:
- minimal abstraction
- explicit data structures
- no hidden magic numbers
- readable control flow
- step-by-step construction
- Header-only
The QR code is generated in several clear steps:
- Encode input data
- Add error correction codewords
- Construct QR matrix
- Apply mask patterns
- Select the best mask
- Write format information
/include
QRcreator.h Main encoding pipeline
/internal
/byte
ByteEncoder.h Convert to bitstream
FinalStream.h Intertwined
/ECC
ECCCalculator.h Reed-Solomon error correction
/Mask
Mask.h Mask evaluation
/QRSpec
QRSpec.h Constants provided by ISO/IEC 18004:2015 simplify calculations during generation.
QRSpec_Blocks.h
QRSpec_Capacity.h
QRSpec_Patterns.h
/Structure
StructureBuilder.h Draw a fixed template
QRMatrix.h Storage structure of QR code
/demo
main.cpp Simple demo
ISO/IEC 18004:2015 QR Code specification