FA-72175 / Error-correcting codes / Member archive
QR format BCH division skips the lowest step · case 05
Remainders are left unreduced for some data values.
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 ["decode", 2309] | ["H", 7, 2] | ["H", 6, 3] | 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 ↗