npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

creditcard-generator

0.0.7 • Public • Published

Credit Card generator

A node.js library for generating test credit card numbers. The card numbers are valid with respect to the Luhn algorithm (Mod 10 test). https://en.wikipedia.org/wiki/Luhn_algorithm

Interface

GenCC([Scheme], [numberOfCards]. [pseudoRandomFunction]);

pseudoRandomFunction must supply random numbers between 0 to 1. Use this in conjunction with a seeded random number generator to reproduce test data.

Usage

generator = require('creditcard-generator')
generator.GenCC();
//Will return 1 MasterCardNumber
generator.GenCC("Amex");
//Will return 1 Amex number
generator.GenCC("VISA", 10);
//Will return 10 VisaCards numbers
generator.GenCC("Mastercard", 3, Math.random)
//Will generator 3 Mastercard numbers using the standard random function

Contributing

All contributions are welcome. Please supply tests.

LICENSE

GNU GPL https://gnu.org/licenses/gpl.html

Project forked from https://github.com/grahamking/darkcoding-credit-card

Keywords

none

install

npm i creditcard-generator

Downloadsweekly downloads

1,171

version

0.0.7

license

none

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability