Nice tut NTSA. You write very nice code.

It should be noted that generating credit card numbers will not let you buy things anywhere, and that this algorithm is publicly available. As anyone with a CC # knows, you must know the expiration date of the card in order to purchase something, this is an often overlooked detail when people say "a cracker broke into our database and stole all the credit card numbers". It's not just the numbers, it's the Expiry date, and the owner, etc..

Most CC validation services nowadays also require you to enter your phone number and address. For instance, I ordered some BOFH stuff from the Register a few weeks ago, and it required not only my credit card number and expiry date, but also my Address and phone number.