rs-card-validate
Detects and validates credit card numbers (type of card, number length and Luhn checksum).
Important notice: this is a fork of @rprotasov initial work, to make it usable in Rust projects.
Supported providers
Debit cards:
- Visa Electron
- Maestro
- Forbrugsforeningen
- Dankort
Credit cards:
- Visa
- MasterCard
- American Express
- Diners Club
- Discover
- UnionPay
- JCB
Install library
In your Cargo.toml
:
[]
= "1.0"
Validate a number
extern crate card_validate;
use Validate;
let card_number = "5236313877109142";
let result = from.expect;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;