php-extended / php-checksum-object
A library that implements the php-extended/php-checksum-interface
Package info
gitlab.com/php-extended/php-checksum-object
pkg:composer/php-extended/php-checksum-object
9.0.1
2026-02-27 08:54 UTC
Requires
- php: >=8.2
- php-extended/php-checksum-interface: ^9
Requires (Dev)
README
A library that implements the php-extended/php-checksum-interface for the object algorithm.
Installation
The installation of this library is made via composer and the autoloading of all classes of this library is made through their autoloader.
- Download
composer.pharfrom their website. - Then run the following command to install this library as dependency :
php composer.phar php-extended/php-checksum-object ^9
Basic Usage
You may use this library the following way :
use PhpExtended\Checksum\Checksumobject;
$checksum = new ChecksumLuhn();
$data = '<put your digit string here>';
$checked = $checksum->matches(substr($data, 0, -1), substr($data, -1));
// returns true if verified
$signed = $data.$checksum->calculate($data);
// appends the calculated digit to the checksum
License
MIT (See license file).