New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

creditcard-generator

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

creditcard-generator

Can generate valid credit card numbers for VISA, Amex, Mastercard, Diners, Discover, EnRoute, JCB, Voyager

  • 0.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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

FAQs

Package last updated on 11 Nov 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc