Reputation: 8098
we are currently printing code 39 barcodes. The operator of the scanner scans the barcodes very quickly and the barcode is outputted incorrectly once out of every 1000 scans. I would like to implement a checksum to catch this output error. Has anyone done something like this in C sharp Python or Java? Can someone help me get started with some resources?
Upvotes: 0
Views: 621
Reputation: 2188
Despite Code 39 Barcodes are often used without checksum, it sometimes is done with a mod 43 checksum appended. Wikipedia provides a small and easy to understand example of how you could do it: http://en.wikipedia.org/wiki/Code_39#Code_39_mod_43
Of course you're completely free to do your own checksum calculation. The goal should of course be a equally distributed output for all possible inputs...
Upvotes: 1
Reputation: 56634
"Code 39 is just about the only type of barcode in common use that does not require a checksum" (http://www.mecsw.com/specs/code_39.html).
If you are determining what the code should be, you are perfectly welcome to add whatever checksum values you like - modulo-43 is apparently pretty standard - or simply demand that every code be a certain number of characters, starting with (for example) N and ending in G.
Upvotes: 0