Simple Test of Credit Card Number Validation Routines

Credit cards are somewhat self-verifying and self-identifying:

Number of digits varies by Issuer with AMEX and Diner's being 15 digit and VISA, MC, Discover and BankCard being 16 (maybe). The test below requires that the number be entered without blanks or dashes. Accepting more free-form input is left as an exercise for the reader.


Supply a CC number:


This code is also available as in C++:
Ken Thompson <thompson@inetnow.net>
Last modified: Wed Dec 20 08:47:53 EST 2000