Luhn (modulo 10) check digit calculator
| From: | Angus Mann | Date: | Tue, 05 Jan 2010 11:05:28 +0000 |
| Subject: | Luhn (modulo 10) check digit calculator | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-300804@lists.php.net to get a copy of this message | ||
Hi all. Perhaps a lazy request, but does anybody have some cut-n-paste code to calculate a Luhn
check-digit?
It's a check-digit often added to the end of things like credit card or account numbers to make
detecting typo's a bit easier.
I found lots of code to validate a number once the check-digit is applied, but nothing to calculate
the digit in the first place.
Thanks in advance !
Angus