Code 128
A high-density one-dimensional barcode specification supporting three code sets (A/B/C) and dynamic code set switching, widely used in logistics, warehousing and similar scenarios.
Timeline (last 90 days)
A user requested generating a Code 128 label for a warehouse bin location, with the content being the pure ASCII string BIN-7742-A.
Two weeks after the barcode label was printed and affixed to the shelf, scanning it with a barcode scanner made the system display "almond" instead of the bin number.
The root cause is that the generator wrote the raw string BIN-7742-A directly into the barcode, and the scanning side interpreted the leading B as the start character of Code 128 Code Set B, causing the overall parsing context of subsequent characters to shift.
The label is technically a fully valid Code 128 barcode, it just encodes the wrong string.
Code 128 defines three code sets (Code Set A, B, C), and the start character (Start A/B/C) determines the code set initially enabled by the decoder.
Code 128's code set switch characters (Code A/B/C, Shift) can dynamically change the decoding context within the data stream.
Code 128's mod 103 check character algorithm is: add the start character value plus the cumulative value of each data character (weighted by code set), then multiply by position weight (the start character has weight 1, increasing thereafter), and finally take the result modulo 103 to obtain the check character value.
The mod 103 check digit can only detect symbol damage and misalignment during transmission or printing, and cannot detect semantic errors such as choosing the wrong start character during encoding.
The developer's fixes include: adding mod 103 check character generation to the generator, rejecting suspicious leading characters by default (unless raw mode is explicitly enabled), and having the API return both the encoded value and the decoded value.
The fixed generator has been packaged and released, including checksum validation and a raw mode option.
1 more timeline events
All Facts (11)
For industries that rely on barcodes, self-developed generators need to verify semantic alignment in addition to compliance, and conduct end-to-end testing with real scanning devices and target systems.
50%UnverifiedCode 128's mod 103 check character algorithm is: add the start character value plus the cumulative value of each data character (weighted by code set), then multiply by position weight (the start character has weight 1, increasing thereafter), and finally take the result modulo 103 to obtain the check character value.
50%UnverifiedThe mod 103 check digit can only detect symbol damage and misalignment during transmission or printing, and cannot detect semantic errors such as choosing the wrong start character during encoding.
50%UnverifiedThe developer's fixes include: adding mod 103 check character generation to the generator, rejecting suspicious leading characters by default (unless raw mode is explicitly enabled), and having the API return both the encoded value and the decoded value.
50%UnverifiedThe root cause is that the generator wrote the raw string BIN-7742-A directly into the barcode, and the scanning side interpreted the leading B as the start character of Code 128 Code Set B, causing the overall parsing context of subsequent characters to shift.
50%UnverifiedThe label is technically a fully valid Code 128 barcode, it just encodes the wrong string.
50%UnverifiedCode 128 defines three code sets (Code Set A, B, C), and the start character (Start A/B/C) determines the code set initially enabled by the decoder.
50%UnverifiedCode 128's code set switch characters (Code A/B/C, Shift) can dynamically change the decoding context within the data stream.
50%UnverifiedTwo weeks after the barcode label was printed and affixed to the shelf, scanning it with a barcode scanner made the system display "almond" instead of the bin number.
50%UnverifiedA user requested generating a Code 128 label for a warehouse bin location, with the content being the pure ASCII string BIN-7742-A.
50%UnverifiedThe fixed generator has been packaged and released, including checksum validation and a raw mode option.
50%