@mihnea.dev/credit-card-generator
TypeScript icon, indicating that this package has built-in type declarations

1.0.9 • Public • Published

Credit Card Generator

A Node.js package that generates valid credit card numbers, expiry dates, and CVV2 codes. The credit card numbers are valid with respect to the Luhn algorithm, and the CVV2 codes are generated using the Tripple-DES algorithm with double length keys.

Installation

To install the credit-card-generator package, run the following command:

npm install @mihnea.dev/credit-card-generator

Usage

To generate a credit card number, expiry date, and CVV2 code, use the following code:

const { default: CreditCardGenerator } = require("@mihnea.dev/credit-card-generator");
/** Initialize new Credit Card Generator */
const carder = new CreditCardGenerator()
/** Create a single card */
const card = carder.generate_one()
/** Create a set of cards */
const set = carder.generate_set(2)
/** Log the results */
console.log(card, '\n', set)

This will output:

{
  number: '4532355776740539',
  expiry: { month: '01', year: '27' },
  cvv2: '510'
} 
 Set(2) {
  {
    number: '4916384806334101',
    expiry: { month: '11', year: '27' },
    cvv2: '040'
  },
  {
    number: '4539505711626762',
    expiry: { month: '04', year: '27' },
    cvv2: '564'
  }
}

Parameters

  1. new CreditCardGenerator() Create a new instance of the CreditCardGenerator class.
(alias) new CreditCardGenerator(encryption_key?: string | null | undefined, cc_presents?: Object<ICCPreset> | null | undefined, service_code?: number | undefined, log_in_console?: boolean | undefined): CreditCardGenerator
  • encryption_key - This parameter is the encryption key that will be used to generate the CVV2 code
  • cc_presents - This parameter is an object that contains credit card vendors with prefixes and digits length (ICCPreset interface)
  • service_code - This parameter is the service code that will be used to generate the credit card number
  • log_in_console - This parameter specifies whether or not the function should log its output to the console
  1. .generate_one() Generate a single credit card.
(method) CreditCardGenerator.generate_one(type?: CreditCardTypes | undefined): ICreditCard
  • type - Type of credit card to be used
  1. .generate_set Generate a set of credit cards.
(method) CreditCardGenerator.generate_set(size: number, type?: CreditCardTypes | undefined): Set<ICreditCard>
  • size - Batch size
  • type - Type of credit card to be used
  1. CreditCardGenerator.check_sum() Check if a credit card is valid with respect to the Luhn algorithm.
(method) CreditCardGenerator.check_sum(number: string): boolean
  • number - Credit card number to be validated

DISCLAIMER

The credit card numbers and additional information produced by this tool are entirely arbitrary and lack any genuine monetary significance. Please refrain from attempting to employ these fictitious credit card details for any transactions, as they are non-functional. Engaging in illegal activities such as attempting to hack or scam using counterfeit credit card information is against the law and may result in penalties, including imprisonment. We unequivocally disapprove of any unlawful actions and will collaborate closely with law enforcement to scrutinize and take legal action against individuals who misuse our tools.

Package Sidebar

Install

npm i @mihnea.dev/credit-card-generator

Weekly Downloads

577

Version

1.0.9

License

MIT

Unpacked Size

19.1 kB

Total Files

17

Last publish

Collaborators

  • mihnea.dev