samlittler / upc
A checksum calculator for the UPC check digit method
Installs: 11 039
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
pkg:composer/samlittler/upc
Requires
- php: ^8
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2025-09-25 17:02:44 UTC
README
A PHP library for calculating UPC (Universal Product Code) checksum digits.
Installation
Download and install this library using composer:
composer require samlittler/upc
Alternatively, download this repository as a ZIP and include the src/UPC.php file in your project.
Usage
Usage is simple
$your_product_code = '03600024145';
$checksum = \SamLittler\UPC\UPC::calculate($your_product_code); // returns 7