selective / luhn
Luhn library, modulo 10
Installs: 20 548
Dependents: 1
Suggesters: 0
Security: 0
Stars: 10
Watchers: 2
Forks: 5
Open Issues: 0
Requires
- php: ^8.1
Requires (Dev)
This package is auto-updated.
Last update: 2024-11-09 22:58:15 UTC
README
Luhn (modulus 10 or mod 10 algorithm) for PHP
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