1.0.3 • Published 3 years ago

@simeon979/card-gen v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Credit Card Generator

version badge

API

generateCard(option)

Generate a valid card either randomly or according to supplied options

If startsWith is provided as an option, endsWith, includeSequence, network and issuer are ignored If includeSequence is provided, endsWith, network and issuer are ignored If endsWith is provided, network and issuer are ignored network and issuer can both be provided, or be present independently

Kind: global function

ParamTypeDescription
optionobjectoptions to fine tune the generated card
option.startsWithstring | numbera sequence of digit between 1 - 10 in length to start the generated card with
option.endsWithstring | numbera sequence of digit between 1 - 10 in length to end` the generated card with
option.includeSequencestring | numbera sequence of digit between 1 - 10 in length to end` the generated card with
option.networkstringthe network of the card to generate
option.issuerstringthe issuer code of the generated card
option.vervebooleanGenerate a verve credit card

lookupCard(bin) ⇒ Object | undefined

Look up information about the BIN of a card and returns an object containing the network and an optional issuer if found or undefined if not found

Kind: global function

ParamTypeDescription
binstring | numberthe card to lookup

computeCheck(card) ⇒ number

Compute the check digit of a number according to the Luhn algorithm

Kind: global function
Returns: number - the check digit

ParamTypeDescription
cardstring | numberthe sequence of number to generate a check digit for according to the Luhn algorithm

validate(card) ⇒ boolean

Validate that a number passes the Luhn check algorithm

Kind: global function
Returns: boolean - the validity of provided number

ParamTypeDescription
cardstring | numberthe sequence of number to validate
1.0.2

3 years ago

1.0.1

3 years ago

1.0.3

3 years ago

1.0.0

3 years ago