3 ms·
Barcodes use the last digit as a checksum. The checksum is some adding up the numbers and multiplying or something, then % 10 (only 0-9 possible values). As you
by andirk 3y ago
Barcodes use the last digit as a checksum. The checksum is some adding up the numbers and multiplying or something, then % 10 (only 0-9 possible values). As you can see with this math, the error checking has a 1/10 of a chance of coincidentally showing a correct checksum in cases where the data is incorrect. Either way, that last digit on barcodes is insignificant to the actual product's unique barcode ID.
Fun story: The barcode was ripped and the checksum # was frayed off of an item I was returning to Home Depot. I frantically tried to do the math quicker that the checker could manually look it up. But they won and I'll never forget it.
https://www.gs1.org/services/how-calculate-check-digit-manually https://www.gs1.org/services/how-calculate-check-digit-manua...
https://www.simplybarcodes.com/barcode_check_digit_calculator.html https://www.simplybarcodes.com/barcode_check_digit_calculato...
- epcoa 3y agoA few common barcodes including UPC work this way but mostly this is the exception. The 2D ones being discussed here like QR and Aztec use actual error correcting codes, so none of them. In the linear space Codabar (libraries) is a widely used example that doesn’t. GS-128 doesn’t, etc.
- js2 3y agoFeynman could've done it, with a little luck anyway. :-) https://www.ecb.torontomu.ca/~elf/abacus/feynman.html https://www.ecb.torontomu.ca/~elf/abacus/feynman.html
- greengrocer4567 3y agoWhen I worked at a grocery store in the 2000s, you didn't need the checksum digit when keying in a barcode by hand. In fact, manually entering the checksum digit would result in a "product not found" error. So I wonder if the checker had to manually look anything up, assuming it was only the checksum digit that was frayed off. Perhaps some POS systems do require the checksum digit for manually-entered barcodes, though.
- akoboldfrying 3y ago>In fact, manually entering the checksum digit would result in a "product not found" error. That is hilarious to me. The obviously safer approach of checking the check digit was not merely neglected, but actively forbidden.
- lifthrasiir 3y agoIt is possible that a check digit could happen to be incorrect from the beginning. This (and more rarely, an accidental code reuse) does happen fairly commonly with ISBN, so I would expect the same for general UPC/EAN.
- efreak 3y agoBarcodes are entered as text. Older barcode scanners used to plug into either the serial port or the PS2 keyboard port; often they had an inline adapter so you could plug it in between your computer and keyboard. As a checksum, the last digit of the barcode is not part of the data (product number), it's metadata; when the barcode reader beeps, that means it has computed the check digit and it matches the digit on the barcode. The barcode data is sent to the computer, but the check digit is not. The check digit is not in the database. The computer using the UPC leaves it to the barcode reader or human to ensure the input is correct. You'll might also notice that similar barcodes exist in multiple places as well--unopened cases of products might have an identifier that includes the UPC, and so does the price sticker on the shelf. Both of these include more data than just the UPC.
- andirk 3y agoAs a grocery checker, I also remember not typing the checksum. It isn't part of the product's ID, but manually typing in probably has a higher chance of error than scanning so what the heck?? Another fun fact: in the intro to The Simpsons, Maggie gets scanned by the clerk as a valid item with a price shown on the register.