PHPackages                             chrsc/luhn-algorithm - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. chrsc/luhn-algorithm

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

chrsc/luhn-algorithm
====================

Validate and create credit/bank/loyalty card numbers

1.0.0(8y ago)524MITPHP

Since Jul 19Pushed 8y ago1 watchersCompare

[ Source](https://github.com/chrsc/LuhnAlgorithm)[ Packagist](https://packagist.org/packages/chrsc/luhn-algorithm)[ RSS](/packages/chrsc-luhn-algorithm/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Luhn Algorithm
==============

[](#luhn-algorithm)

I created this as a utility class that will be used to validate card numbers, this works for credit card numbers, bank accounts, loyalty card numbers, and all other card numbers that follow the modulus 10 formula.

Other uses: Validate Canadian SIN / Greek SSN / Israel ID numbers, NPI numbers for American health care, IMEI numbers.

This could not have been created without [Hans Peter Luhn's](https://en.wikipedia.org/wiki/Luhn_algorithm) Algorithm.

Validate numbers
----------------

[](#validate-numbers)

```
