Code128 Barcode Validation

357 views
Skip to first unread message

Rafael Guerra

unread,
Feb 11, 2016, 12:10:23 PM2/11/16
to zxing
In my application, I have a barcode string (Code128 or not). Is possible in ZXing to validate this string if is really a Code128 Barcode ?

Bas Vijfwinkel

unread,
Feb 11, 2016, 11:37:47 PM2/11/16
to zxing
Code128 has a check digit so if your barcode is not valid than it is likely that the check digit will also fail.
Besides the check digit, the code128 standard needs some whitespaces before and after the barcode and for detection a start and stop character have been added.
There is not much chance that you just scan something that will match a code128 barcode.
So if ZXing says it is valid, it probably is.
If it cannot scan the code than it is either something else or the code isn't readable.

Some other barcodes like codabar are lacking these features and can generate a false positive more easily.

Reply all
Reply to author
Forward
0 new messages