New User? Sign Up  |  Sign In  |  Help
Barcode support and
tutorials from IDAutomation
and the community.
Click for the BBB Business Review of this Computers Hardware, Software & Services in Tampa FL
Resolved Questions Bookmark and Share
churst

Why is the ISBT128 ISO Mod37 calculation Wrong?

What is the method to calculate the K Code (i.e. Check Digit) for an ISBT 128 Barcode wrong? Please review and correct the source code from the following link:
https://www.barcodefaq.com/1d/isbt-128/#ISO_7064_MOD_37-2_Algorithm

Below is a reference to the correct formula for the calculation. See Appendix A.1.
The specific issues in the method above are the following
* The WeightedSum formula is wrong. It's not a multiplication by 2 and a modulo, rather it's a 2 ^n Power where n is the reverse "position" of the character within the string (i.e. 13-1). The Modulo is also not calculated inside the for loop, rather outside of the for loop ==> WeightedSum = WeightedSum + (CharValue * 2^n)
* The CheckDigitAscValue is wrong as the Modulo needs to be taken on the complete sum total of WeightedSum ==> CheckDigitAscVal = (38 - (WeightedSum % 37)) % 37

http://www.iccbba.org/uploads/a3/56/a35603c2b626a45573cd98663086625f/ST-001-ISBT-128-Standard-Technical-Specification-v5.10.0.pdf

Operating System: Windows

Application: Visual Studio

02-06-19     193 day(s) ago    

  Report Abuse

 

Brant

Best Answer

Referring to the ā€˜Cā€™ language function CalculateMod37_2 on page 168 of the specification, the code we have appears correct and I have tested it with a few values, such as A9999 15 000001 = M and that also appears correct.

Posted 192 day(s) ago

()
()
  Report Abuse
 
Find Interesting
 
Email to Others
 
Bookmark
 
Subscribe to Answer Alert
No comments yet.     Be the first to comment.
Other Answers (1)

churst
For clarification, I'm not using your formula and as such the info provided above is untested sudo code. I was mainly attempting to help others that may stumble upon this sample code and think the functionality is correct as is. The ICCBBA reference above is the standards body which specifies the ISBT 128 checksum formula and is where the calculation steps were pulled from.

My request would be to either correct the method or pull it down so other's don't come across it and use it

Posted 192 day(s) ago

()
()
   Report Abuse
Email this question link to friends
You must enter an email address, if name is entered or vice-versa for each friend.
Friend #1 -
Friend #2 -
Friend #3 -
Friend #4 -
Friend #5 -
  Your comment on this question
  |         |  
bold  italic  underline  strike       big  small       superscript  subscript 
  Allows to add a link. Added links would only be converted to actual clickable link, when the domain of the link is white-listed by administrator.
Caption :
Link URL :
(Must starts with "http://")
Add  |   Cancel
  Allow to insert an image. Must be among the following file types - *.jpg, *.gif, *.png & *.bmp.
Image Url :   Upload New
(Image url must always starts with " http:// ")
Width : pixels
(Must not be greater than 450px. Enter 0px for no resize)
Add  |   Cancel
  Allow to insert YouTube video. Insert the video embed code.
Embed Code :
Add  |   Cancel
Up to 5000 Characters are allowed. Current Count: 0
  Your comment on this answer
  |         |  
bold  italic  underline  strike       big  small       superscript  subscript 
  Allow you to add a link. Added links would only be converted to actual clickable link, when the domain of the link is white-listed by administrator.
Caption :
Link URL :
(Must start with "http://" or "https://")
Add  |   Cancel
  Allow to insert an image. Must be among the following file types - *.jpg, *.gif, *.png & *.bmp.
Image Url :   Upload New
(Image url must always start with "http://" or "https://")
Width : pixels
(Must not be greater than 450px. Enter 0px for no resize)
Add  |   Cancel
  Allow to insert YouTube video. Insert the video embed code.
Embed Code :
Add  |   Cancel
Up to 5000 characters are allowed. Current Count: 0

You may answer and comment on any thread according to the Terms and Conditions.

 © Copyright 2019 IDAutomation.com, Inc., All Rights Reserved. Legal Notices.

 Barcode Fonts | Components | Scanners | Support | Contact Us
Training Videos on YouTube Join us on Google Plus Join us on LinkedIn Follow us on Twitter Like us on Facebook