https://github.com/selective-php/luhn
Luhn (Modulo 10 or mod 10 algorithm) for PHP
https://github.com/selective-php/luhn
hacktoberfest luhn luhn-checksum php
Last synced: about 1 year ago
JSON representation
Luhn (Modulo 10 or mod 10 algorithm) for PHP
- Host: GitHub
- URL: https://github.com/selective-php/luhn
- Owner: selective-php
- License: mit
- Created: 2015-04-22T22:00:37.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2023-09-09T20:27:09.000Z (over 2 years ago)
- Last Synced: 2024-10-13T19:46:24.537Z (over 1 year ago)
- Topics: hacktoberfest, luhn, luhn-checksum, php
- Language: PHP
- Homepage:
- Size: 32.2 KB
- Stars: 10
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Luhn
[Luhn](https://en.wikipedia.org/wiki/Luhn_algorithm) (modulus 10 or mod 10 algorithm) for PHP
[](https://packagist.org/packages/selective/luhn)
[](LICENSE)
[](https://github.com/selective-php/luhn/actions)
[](https://scrutinizer-ci.com/g/selective-php/luhn/code-structure)
[](https://scrutinizer-ci.com/g/selective-php/luhn/?branch=master)
[](https://packagist.org/packages/selective/luhn/stats)
## Requirements
* PHP 8.1+
## Installation
```
composer require selective/luhn
```
## Usage
### Create a number
```php
create('7992739871'); // 3
```
### Validate a number
```php
validate('79927398713'); // true
$luhn->validate('79927398710'); // false
```
## License
* MIT