IsoCodes icon indicating copy to clipboard operation
IsoCodes copied to clipboard

[meta-ticket] GS1 / GTIN code validator

Open ronanguilloux opened this issue 8 years ago • 3 comments

http://www.gs1.org/how-calculate-check-digit-manually

ronanguilloux avatar Mar 15 '16 08:03 ronanguilloux

  • ~~GTIN-12~~
  • ~~UPC-12~~
  • ~~UPC-A~~
  • ~~GTIN-13 (GLN)~~
  • ~~GTIN-14~~
  • ~~SSCC~~
  • ~~GLN~~
  • ~~GRAI~~
  • ~~GIAI~~
  • ~~GDTI~~
  • ~~GSRN~~
  • ~~UDI~~
  • GS1-128 Structure

see:

  • http://www.activebarcode.com/codes/?close=
  • http://www.gtin.info/check-digit-calculator
  • http://www.gs1-128.info
  • http://www.epc-rfid.info
  • http://www.databar-barcode.info
  • http://www.udi-barcode.info

And:

  • https://github.com/charithe/gtin-validator
  • http://code.activestate.com/recipes/577963-gtin-validate-check-digit-or-add-check-digit/
  • https://boapi.googlecode.com/svn/trunk/src/php/ (Apache License)
  • http://codereview.stackexchange.com/questions/19438/upc-a-validation

ronanguilloux avatar Mar 18 '16 09:03 ronanguilloux

These validators will return true for a string containing all zeroes (if the string length is correct). That edge case has to be either handled in the code or intentionally left like it is. No matter what you choose to do, this behavior needs to be documented somewhere where users can't miss it.

tbmatuka avatar Jul 19 '17 13:07 tbmatuka

Thanks for reporting, @tbmatuka. Just shared fixes in #120 and tagged a new 2.1.2 version

ronanguilloux avatar Aug 08 '17 17:08 ronanguilloux