credit_cat 0.4.0 copy "credit_cat: ^0.4.0" to clipboard
credit_cat: ^0.4.0 copied to clipboard

outdated

A library for checking credit cards with the Luhn algorithm.

credit_cat #

credit_cat is a library for checking credit card numbers using the Luhn algorithm. Besides identifying if the number is valid or not, It will also let you know who is the issuer of the card is and industry it falls under.

Overview #

import 'package:credit_cat/credit_cat.dart';

void main() {
  final cat = CreditCat("378282246310005");
  print(cat.isValid); // true
  print(cat.issuer); // Issuers.AMEX
  print(cat.industry); // Industries.TRAVEL_AND_ENTERTAINMENT

  print(cat.issuer == Issuers.AMEX); // true
  print(cat.industry == Industries.TRAVEL_AND_ENTERTAINMENT); // true
}

Dirty Number #

credit_cat will automatically remove any space or dashes from the string passed to it but you are also able to pass your own regular expression into CreditCat,

final cat = new CreditCat("1*2*3*2*1*3*2*1*7", new RegExp(r"\*"));
print(cat.cardNumber == "123213217"); // true  
0
likes
0
points
78
downloads

Publisher

verified publisher128bit.io

Weekly Downloads

A library for checking credit cards with the Luhn algorithm.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on credit_cat