samlittler / upc
There is no license information available for the latest version (v2.0.0) of this package.
A checksum calculator for the UPC check digit method
v2.0.0
2022-05-25 09:35 UTC
Requires
- php: ^8
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2025-02-25 15:49:58 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