Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CardType ¶
type CardType int
CardType represents card number type to be generated
const ( AmericanExpress CardType = iota + 1 DinersClub DinersClubUS Discover JCB Laser Maestro Mastercard Solo Unionpay Visa Mir )
Supported card types
func (CardType) GenerateOfLength ¶
GenerateOfLength generates card number of specified length If length is not valid, random among valid ones will be used
func (CardType) ValidLength ¶
ValidLength validates if specified card length is valid for the card type
func (CardType) ValidNumber ¶
ValidNumber validates card number for a prefix and Luhn algo @todo: add card prefix check
Click to show internal directories.
Click to hide internal directories.