feat(barcodes): Code 39 (#154) and UPC-E (#155) - #158
Merged
Conversation
Add Code 39 (ISO/IEC 16388 / AIM USS-39) as a Barcode1D with an optional modulo-43 check character, Full ASCII (Extended Code 39) mode, and a configurable wide/narrow ratio; and UPC-E (zero-suppressed UPC-A) as a new EanSymbology value. - Code39Barcode + Code39/ (encoder, plus the 43-character and Full-ASCII tables transcribed from AIM USS-39 Table 2 and verified character by character). - EanSymbology.UpcE with UPC-A<->UPC-E compression and expansion, the number-system parity tables, and a length invariant on the expansion. - DefaultAltText arms, docs/barcodes-guide.md sections, and encoder / table / property / decode-oracle tests. PublicAPI.Unshipped updated. Decode round-trips verified against zxing-cpp for Code 39 and UPC-E, including UPC-E symbols whose sixth digit is 5-9.
Tim81
force-pushed
the
barcodes-code39-upce
branch
from
July 6, 2026 15:38
50553d1 to
9c46bec
Compare
This was referenced Jul 7, 2026
This was referenced Jul 8, 2026
This was referenced Aug 19, 2026
This was referenced Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second PR in the v1.10 barcode expansion, stacked on #157 (merge #157 first — GitHub retargets this to
mainautomatically once #157 lands).Symbologies
Code39Barcode : Barcode1Dwith an optional modulo-43 check character, Full ASCII (Extended Code 39), and a configurable wide/narrow ratio (2.0–3.0). The 43-character and Full-ASCII pattern tables were transcribed from AIM USS-39 Table 2 (the specification ISO/IEC 16388 is based on) and verified character by character.EanSymbology.UpcE, the zero-suppressed form of UPC-A, with full UPC-A↔UPC-E compression/expansion, the number-system parity tables, and a length invariant guarding the expansion.New public surface (in
PublicAPI.Unshipped.txt):Code39Barcode(+Content/CheckDigit/FullAscii/WideNarrowRatio) andEanSymbology.UpcE.Review + testing
This branch went through an adversarial review that caught a UPC-E expansion defect (the last-digit-5–9 case produced a 12-digit UPC-A and a wrong check digit, rendering ~half of UPC-E inputs unscannable). It is fixed, guarded by a length invariant, and covered by a decode-oracle test that renders a 5–9 UPC-E and decodes it with zxing-cpp (decoded
0012345000058, matching).Verified locally:
dotnet build -c Release(0 warnings), 649 tests pass (the decode oracle ran for real — pdftoppm + zxing-cpp installed),dotnet format --verify-no-changesclean, clean-room check pass. Decode round-trips verified against zxing-cpp for Code 39 and UPC-E.Known minor deferral: empty Code 39 content encodes to a bare start/stop symbol rather than being rejected — low severity, noted for a follow-up.