Skip to content

Latest commit

 

History

History
51 lines (32 loc) · 1.28 KB

README.md

File metadata and controls

51 lines (32 loc) · 1.28 KB

Luhn

Luhn (modulus 10 or mod 10 algorithm) for PHP

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Requirements

  • PHP 8.1+

Installation

composer require selective/luhn

Usage

Create a number

<?php

use Selective\Luhn\Luhn;

$luhn = new Luhn();

echo $luhn->create('7992739871'); // 3

Validate a number

<?php

use Selective\Luhn\Luhn;

$luhn = new Luhn();

$luhn->validate('79927398713'); // true
$luhn->validate('79927398710'); // false

License

  • MIT