Search code examples
barcodechecksumcode128

Checking a ITF or Code 128 bar code integrity in a final string


There is a software that is able either to receive bar codes scanned by bar code scanner app or enter them manually.

With EAN everything is pretty clear: it contains a checking digit and using a special algorithm I can check code integrity when code is entered manually.

With ITF or Code 128 it seems not to be so. It seems that integrity check exists only on bar code level and once a final code string was produced there is no means to check its integrity. Did I understand it right?


Solution

  • You have three different cases with these barcode types:

    EAN/UPC the check digit is integral to the symbol (meaning the reader will verify the scan against the check digit), is printed in human readable form, and is part of the value returned by the reader.

    Code128 the check digit is integral to the symbol but is not normally printed in human readable form nor is it typically returned by a reader. When entering the code manually, the check digit is not part of the data.

    With ITF14 the check digit is not integral to the symbol so the reader may not verify it. ITF14 is just a 2-of-5 symbol unless the reader is configured to only accept ITF14 and in that case, should verify the check digit. The check digit is normally printed in human-readable form and is returned by the reader. When manually entering an ITF14, the check digit is typically part of the value entered.

    With ITF14, a lot of the behavior depends on the configuration of the reader.