upc


upc, a C++ code which computes the check digit associated with a uniform product code (UPC), or reports whether a 12-digit UPC is actually valid.

Licensing:

The information on this web page is distributed under the MIT license.

Languages:

upc is available in a C version and a C++ version and a Fortran90 version and a MATLAB version and an Octave version and a Python version.

Related Data and Programs:

upc_test

bank, a C++ code which computes the check digit associated with a US Bank Routing Number check digit, or reports whether a 9-digit code is actually valid.

isbn, a C++ code which determines the check digit for an International Standard Book Number or reports whether a given ISBN is valid.

luhn, a C++ code which computes the Luhn check digit for a string, or validates a string.

Reference:

  1. David Savir, George Laurer,
    The Characteristics and Decodability of the Universal Product Code,
    IBM Systems Journal,
    Volume 14, Number 1, pages 16-34, 1975.

Source Code:


Last revised on 10 April 2020.