Expand description
§idsmith
Validate and generate checksum-correct IBANs, personal IDs, bank accounts, credit cards, SWIFT/BIC, company IDs, driver’s licenses, tax IDs, passports, LEI codes, and EU VAT numbers. Every identifier passes mod-97 (IBAN) and national checksum validation.
§Quick Start
use rand::thread_rng;
use idsmith::{iban, personal_id};
let mut rng = thread_rng();
// Generate a German IBAN
let code = iban::generate_iban(Some("DE"), &mut rng).unwrap();
println!("{}", iban::format_iban(&code));
// Generate an Estonian personal ID
let registry = personal_id::Registry::new();
let opts = personal_id::GenOptions::default();
let id = registry.generate("EE", &opts, &mut rng).unwrap();
println!("{}", id);§idsmith
A comprehensive Generator and Validator for valid, checksum-correct identifiers. Supports IBANs, Personal IDs, Bank Accounts, Credit Cards, SWIFT/BIC, Company IDs, Driver’s Licenses, Tax IDs, Passports, LEI codes, and EU VAT numbers.
§Quick Start (Generation)
use rand::thread_rng;
use idsmith::{bank_accounts, personal_ids};
let mut rng = thread_rng();
// Generate a German IBAN
let code = idsmith::iban::generate_iban(Some("DE"), &mut rng).unwrap();
// Generate an Estonian personal ID
let id = personal_ids().generate("EE", &Default::default(), &mut rng).unwrap();§Quick Start (Validation)
use idsmith::{credit_cards, personal_ids};
// Validate a credit card number
let is_valid = credit_cards().validate("4152839405126374");
// Validate a US Social Security Number
let is_ssn_valid = personal_ids().validate("US", "446-72-2445").unwrap_or(false);Modules§
- bank_
account - company_
id - countries
- Centralized registry of ISO 3166-1 alpha-2 country codes and names. This list covers 250+ countries and territories supported by the library.
- credit_
card - csv
- Optional CSV formatting for IBAN and personal ID results.
- driver_
license - iban
- lei
- passport
- personal_
id - swift
- tax_id
- vat
Functions§
- bank_
accounts - Global registry for bank accounts. Provides methods to generate, validate, and format bank account numbers.
- company_
ids - Global registry for company IDs. Provides methods to generate and validate business identifiers (VAT, EIN, CIF) for all countries.
- credit_
cards - Global registry for credit cards. Provides methods to generate and validate credit card numbers for major brands (Visa, Mastercard, Amex, etc.).
- driver_
licenses - Global registry for driver’s licenses. Provides methods to generate and validate driver’s license numbers for all countries.
- lei_
codes - Global registry for LEI (Legal Entity Identifier) codes. Provides methods to generate and validate ISO 17442 LEI codes.
- passports
- Global registry for passport numbers. Provides methods to generate and validate passport numbers for all countries.
- personal_
ids - Global registry for personal IDs. Provides methods to generate, validate, and parse national ID numbers (SSN, CPF, Aadhaar, etc.).
- swift_
codes - Global registry for SWIFT codes. Provides methods to generate and validate 8 and 11 character SWIFT/BIC codes.
- tax_ids
- Global registry for tax IDs. Provides methods to generate and validate tax identification numbers (PAN, TIN, etc.) for all countries.
- vat_ids
- Global registry for VAT numbers. Provides methods to generate and validate EU VAT identification numbers.