DataMatrixEncoder

Pure-Kotlin Data Matrix (ECC 200) encoder.

Implements the square ECC 200 symbols from 10×10 up to 52×52 using ASCII encodation, Reed-Solomon error correction over GF(256) with the Data Matrix primitive polynomial 0x12D, and the standard ECC 200 symbol-character placement (the "bit-walk" algorithm from ISO/IEC 16022 Annex F, including the four corner special cases). The finder "L" pattern and the alternating timing tracks are drawn into the mapping matrix as the module grid is assembled.

Scope. ASCII encodation only — digits are still packed two-per-codeword via the standard digit-pair rule (codeword value = 10·d1 + d2 + 130), and any other byte 0..127 is encoded as value + 1. Bytes above 127 (extended ASCII / arbitrary binary) are out of scope and rejected; callers needing binary payloads should pre-encode them. Rectangular symbols and the C40 / Text / X12 / EDIFACT / Base-256 modes are intentionally not implemented.

Functions

Link copied to clipboard

Encodes data into a square ECC 200 Data Matrix.