card_utils library

Constants

LENGTH_AMERICAN_EXPRESS → const int
15
LENGTH_COMMON_CARD → const int
16
LENGTH_DINERS_CLUB → const int
14
MAX_LENGTH_AMEX_DINERS → const int
17
MAX_LENGTH_COMMON → const int
19

Functions

getLengthForBrand(String cardBrand) → int
getPossibleCardType(String cardNumber, { bool shouldNormalize: true }) → String
isValidCardLength(String cardNumber, { String cardBrand }) → bool
Checks to see whether the input number is of the correct length, given the assumed brand of the card. This function does not perform a Luhn check. [...]
isValidCardNumber(String cardNumber) → bool
Checks the input string to see whether or not it is a valid card number, possibly with groupings separated by spaces or hyphens. [...]
isValidLuhnNumber(String cardNumber) → bool
Checks the input string to see whether or not it is a valid Luhn number. [...]