benkeen/generatedata — pull request #170 by rsicher1 (2013-11-17 18:06:29+00:00)
Title: Added Credit Card Nums data type

I stumbled upon this tool about 2 months ago while looking for ways to quickly generate random data for an application I was building. Really excellent work on your part. You've built a really nice platform here.

I also wanted to say thank you, thank you, thank you for making it open source. I actually had a need to generate random, realistic credit card numbers for the application I was building, and thanks to you, I was able to download the application and script a data type plugin to accomplish this. I wanted to share it with you and hopefully, the world.

In this data type plugin, several credit card types are available to choose from (American Express, Mastercard, and Visa). Each generated credit card number includes a valid prefix and number length for its credit card type. The digits in each credit card number after the prefix are randomly generated aside from the last digit (checksum digit) which is calculated to ensure the credit card number passes Luhn algorithm (http://en.wikipedia.org/wiki/Luhn_algorithm) validation.

I leveraged the chosen js plugin to handle credit card type selection. In the future, I'd like to add more credit card types for users to choose from and maybe use the example column in some way.

Although the commit includes some modified files outside of the plugins/dataTypes/CreditCard folder, you can ignore them. The plugin itself should be entirely self-contained in that folder.

If you have any questions or comments, feel free to contact me.