We help IT Professionals succeed at work.

Luhn's algorithm Mod 10

Luhn's algorithm( Mod 10)  is used an an industry standard for validating Credit card. As far as I know the max length of an credit card is 19 ..Does Mod 10 edit works on 20-21 length of credit cards?
Comment
Watch Question

James MurrellProduct Specialist

Commented:
great site that should help is http://www.beachnet.com/~hstiles/cardtype.html.

The developers here use it for www.webbooker.com and you2choose.com.

James
Top Expert 2012
Commented:
>>Does Mod 10 edit works on 20-21 length of credit cards? <<
It should work for any length.
rbhargawFounder

Author

Commented:
I have a VB script for Check Digit calculator and an existing code in C++ in the applications..Both are giving identical Check digits till 20 but after 21 both have non identical Check digits..so wondering if there is any restriction for the algorithm
Top Expert 2012

Commented:
Try posting the code.
James MurrellProduct Specialist

Commented:
To be honest that needs to be asked in the c++ zone
Top Expert 2012

Commented:
Good point.  I thought the user was looking for some T-SQL code.  I beleive I have posted some code to that effect here many years ago.