php-extended/php-checksum-object

A library that implements the php-extended/php-checksum-interface

7.0.7 2024-12-08 22:41 UTC

This package is auto-updated.

Last update: 2024-12-08 21:41:57 UTC


README

A library that implements the php-extended/php-checksum-interface for the object algorithm.

coverage build status

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.phar from their website.
  • Then run the following command to install this library as dependency :
  • php composer.phar php-extended/php-checksum-object ^7

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).