| Crates.io | credit_card_types |
| lib.rs | credit_card_types |
| version | 0.1.200 |
| created_at | 2023-08-05 20:55:18.835641+00 |
| updated_at | 2024-01-06 19:52:49.347008+00 |
| description | Detect credit card types by number |
| homepage | |
| repository | https://github.com/OLoKo64/credit-card-types |
| max_upload_size | |
| id | 936786 |
| size | 36,953 |
The Credit Card Type library for Rust provides a utility method to determine the type of credit card based on both fully qualified and partial card numbers.
use credit_card_types::{CreditCardPool, CreditCardType};
fn main() {
// Create a new pool.
let pool = CreditCardPool::new();
// Get the credit card type for a given card number.
let result = pool.get_credit_card_type("4111111111111111").unwrap();
// Print the result.
println!("Credit card type: {:#?}", result);
}
This project is licensed under the MIT License - see the LICENSE file for details.