FA-72164 / Error-correcting codes / Member archive
QR format encoder omits the 0x5412 mask · case 04
Format words disagree with printed symbols; decoding finds nothing within distance 3.
Case contract
QR code format information, a BCH(15,5) code. "encode" takes [level, mask] with level bits L=01, M=00, Q=11, H=10 and mask 0..7 (else None): data = level<<3 | mask, append the 10-bit remainder of data*x^10 modulo 0x537, then XOR 0x5412. "decode" takes a 15-bit integer and returns [level, mask, distance] for the unique format word within Hamming distance 3, else None.
Why this case matters
QR readers must recover the error-correction level and mask pattern before decoding any data module.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression ["encode", ["Q", 3]] | 28180 | 14854 | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗