Australia Post, the postal code that repairs what it reads - #234
Merged
Conversation
Closes the four-state family. An eight-digit sorting code, an optional customer information field, and one option — the Format Control Code, because the same sorting code drawn as Reply Paid and drawn as ordinary mail are two different articles and nothing in the payload says which. It is the only postal code here that corrects rather than detects: four Reed-Solomon codewords over GF(64), reusing the field Aztec and MaxiCode already brought. That is why the bars group in threes and why the Standard Customer Barcode is thirty-seven bars rather than thirty-six — a filler bar exists so the codeword count divides. Both character tables are derived rather than transcribed: sixty-four three-bar patterns and ten two-bar ones are one enumeration read at two widths. The customer field is sized in bars, not characters, so a half-filled field is refused rather than padded — filler bars in the middle of a text field index as lower-case letters. Verified bar for bar against zint over 527 symbols, swept until every parity codeword value appears in every parity position, plus the parity checked by its definition in a field the test builds for itself.
s2x
added a commit
that referenced
this pull request
Sep 3, 2026
Australia Post, the postal code that repairs what it reads
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.
The twenty-ninth generator, and the last of the four-state postal codes.
australia-post(aliasesauspost,australia-post-4state,customer-barcode), pure PHP, one option.What it is
An eight-digit sorting code — the Delivery Point Identifier — optionally followed by a customer information field. After Intelligent Mail the layout reads like a relief: start bars, Format Control Code, sorting code, customer field, parity, stop bars, every field at a fixed offset.
What it spends instead is the parity. It is the only postal code here that corrects: four Reed–Solomon codewords over GF(64), repairing two of them.
Encoding\ReedSolomonGf2malready spoke that field for Aztec and MaxiCode, so this reused rather than grew. It is also why the bars group in threes — three bars are six bits are one codeword — and why the Standard Customer Barcode is thirty-seven bars rather than thirty-six: one filler bar exists so the count divides.Two decisions
The Format Control Code is an option. Six codes exist. Three are what the article is — Reply Paid, Routing, Redirection — and nothing in the data says which was meant. The other three (11, 59, 62) are not a choice: they follow from the width of the customer field, so
Payloadpicks them.A half-filled customer field is refused, not padded. The field is sized in bars rather than characters, which is why the lengths look arbitrary and are not: 5 or 10 characters, or 8 or 15 digits. Padding a shorter one would mean inventing semantics no reader has agreed to — filler bars in the middle of a C-table field index as lower-case letters — and zint will not draw such a symbol for comparison either.
Both character tables are derived rather than transcribed. They turned out to be one enumeration read at two widths: combinations with no tracker bar first in ascending order, then those with a tracker in the leading bar, then the leftovers.
Verification
composer reference:australia-post), covering all six Format Control Codes and every character of both tables at the front, middle and back of both field widths.DecoderRoundTripTest, with the family's standing no-free-decoder caveat and its expiry test.Suite: 16103 tests, 269831 assertions.
composer lintclean.