Python Credit Card Mod10 Check
Description:
This is a small python script that contains logic for checking or generating valid (or invalid) credit card numbers. This script is (for instance) intended for people doing data validation for e-commerce applications. It includes the following functions:
- check(cc) - returns True if a given 'cc' string is passes mod10, False otherwise.
- make_number(prefix, length) - generates a mod10-valid credit card number 'length' digits long that starts with a given 'prefix'
- make_invalid_number(prefix,length) - the inverse of make_number, this generates a number with the same characteristics that will fail the mod10 check.
Note: Passing mod10 doesn't mean that a card number really exists out in the world: this is *not* a program for would be credit card thieves. For instance, there isn't any way to autogenerate valid names, billing information, or CSV codes. So don't ask.
Download:
ccmod10.py.txt