Module gtin_validate::gtin12

source ·
Expand description

Performs validation and correction of GTIN-12 and UPC-A codes.

Enums

Errors that make GTIN-12 correction impossible.

Functions

Check that a UPC-A code is valid by confirming that it is made of exactly 12 digits and that the check-digit is correct.
Attempt to fix invalid UPC codes by stripping whitespace from the left and right sides and zero-padding the UPC if it is less than 12 digits in length.