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.
Available as a Rust crate, Python package, and Node.js module — all powered by the same Rust core.
Install
# Rust (library only, no CLI deps)
# Rust (with JSON serialization)
# Rust (CLI)
# Python
# Node.js
Cargo Features
| Feature | Description | Default |
|---|---|---|
cli |
Full CLI binary (clap, csv, json) | Yes |
json |
serde::Serialize on all result types |
No |
csv |
CSV output formatting | No |
Use default-features = false when using as a library to keep dependencies minimal.
Quick Example
// Rust
use ;
let valid = credit_cards.validate;
let ssn_ok = personal_ids.validate.unwrap_or;
let pan_ok = tax_ids.validate;
let passport_ok = passports.validate;
let dl_ok = driver_licenses.validate;
let vat_ok = vat_ids.validate;
let lei_ok = lei_codes.validate;
# Python
# True
# True
# True
# True
# True
# True
=
// Node.js
const = require;
; // true
; // true
; // true
const passport = ;
; // true
; // true
; // true
const iban = ;
Features
- 124 IBAN countries with mod-97-10 checksum validation
- 159 bank account formats — US ABA, MX CLABE, AU BSB, IN IFSC, and more
- 97 personal ID formats — SSN, CPF, Aadhaar, PESEL, Codice Fiscale, etc.
- 6 credit card brands — Visa, Mastercard, Amex, Discover, JCB, Diners (Luhn)
- SWIFT/BIC codes — valid 8 and 11 character codes
- 250 company ID formats — VAT numbers, EINs, CIFs with checksums
- 79 driver's license formats — with country-specific checksum and format validation
- 80 tax ID formats — with checksum validation (PAN, TIN, CPF, SIN, Steuer-IdNr, USCI, Partita IVA, NIF, BSN, RFC, and more)
- 79 passport formats — with country-specific format validation
- LEI codes — ISO 17442 Legal Entity Identifiers with mod-97 checksum
- 28 EU VAT number formats — all EU member states + GB with country-specific checksums (cross-validated against python-stdnum)
- CLI tool with JSON and CSV export
Performance
IBAN validation throughput (100k iterations, single-threaded):
| Library | Language | Throughput | vs idsmith |
|---|---|---|---|
| idsmith | Rust | ~1,310,000 ops/s | — |
ibantools |
Node.js | ~460,000 ops/s | ~2.8x slower |
python-stdnum |
Python | ~54,000 ops/s | ~24x slower |
Extended document validation (idsmith Rust):
| Document Type | Throughput | vs Node.js alternatives |
|---|---|---|
| Personal ID (US SSN) | ~9,300,000 ops/s | ~30x faster |
| Credit Card (Visa) | ~14,900,000 ops/s | ~53x faster |
| Driver License (US) | ~10,100,000 ops/s | — |
| Passport (DE) | ~19,100,000 ops/s | — |
| Tax ID (India PAN) | ~7,800,000 ops/s | — |
Python and Node.js bindings call the same Rust core — same speed, same correctness.
Projects Using idsmith
- MockBanker — Web app implementing nearly all idsmith features, generate realistic mock banking and identity data in the browser
Documentation
License
MIT