Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Code 128
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Check digit calculation=== The check digit is a weighted modulo-103 checksum. It is calculated by summing the start code 'value' to the products of each symbol's 'value' multiplied by its position's weight in the barcode string. The start symbol ''and'' first encoded symbol are in position 1. The sum of the products is then reduced modulo 103. The remainder is then converted back to one of the 103 non-delimiter symbols (following the instructions given [[#Conversion to char|below]]{{clarify|pre-text=invalid link, |post-text=(see {{diff||566495153||the difference}})|date=April 2025}}) and appended to the barcode, immediately before the stop symbol. For example, in the following table, the code 128 variant A checksum value is calculated for the alphanumeric string PJJ123C: {| class="wikitable" style="text-align:right;" |- ! Code !! Value !! Weight !! Value Γ Weight |- | Start Code A || 103 || (1) || 103 |- | P || 48 || 1 || 48 |- | J || 42 || 2 || 84 |- | J || 42 || 3 || 126 |- | 1 || 17 || 4 || 68 |- | 2 || 18 || 5 || 90 |- | 3 || 19 || 6 || 114 |- | C || 35 || 7 || 245 |- |style="border-right:none"| |colspan=2 style="border-left:none"| Sum || 878 |- |style="border-right:none"| |colspan=2 style="border-left:none"| Remainder mod 103 || 54 |} So the value 54, which equals a V, is appended, then followed by the Stop code. For the purpose of computing the check symbol, the shift and code-switch symbols are treated the same as any other symbol in the bar code.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)