idsmith
Validate and generate checksum-correct IBANs, personal IDs, bank accounts, credit cards, SWIFT/BIC, and company IDs for 252 countries.
Built for developers and QA engineers who need a robust way to validate existing identifiers or create realistic, algorithmically valid test data.
Features
- Validator + Generator — verify existing strings or create new data
- 96 IBAN countries — full IBAN registry coverage with mod-97-10 checksum validation
- 252 bank account formats — US ABA routing, MX CLABE, AU BSB, IN IFSC, AR CBU, NG NUBAN, BR mod-11, etc.
- 252 personal ID formats — 56 checksum-verified (SSN, CPF, Aadhaar, Resident ID) + generic fallbacks
- 252 company ID formats — VAT numbers, EINs, and Business IDs with major economy checksums
- Universal Credit Cards — Visa, Mastercard, Amex, Discover, JCB, and Diners Club with Luhn support
- SWIFT/BIC — valid 8 and 11 character codes with ISO country positioning
- Single binary — instant startup, no runtime dependencies
- Library + CLI — use as a lightweight Rust crate or a standalone tool
- JSON & CSV export — built-in support for RFC 4180 CSV and pretty-printed JSON
Installation
CLI Usage
1. Validating Data
Use the validate command to check if a code is checksum and format correct.
# Validate an IBAN
# Validate a National ID (requires country code)
# Validate a Credit Card
2. Generating Data
Generate any identifier using subcommands. Use the optional count positional argument.
# Generate 5 German IBANs
# Generate 3 US Bank Accounts in JSON
# Generate a random Credit Card
Library (SDK) Usage
Add idsmith to your Cargo.toml. For a lightweight build, disable default features to exclude the CLI logic.
[]
= { = "0.4.0", = false }
SDK Validation API
use ;
// Global registries provide thread-safe, easy access
let cards = credit_cards;
let ids = personal_ids;
// 1. Validate simple formats (returns bool)
let card_ok = cards.validate;
let swift_ok = swift_codes.validate;
// 2. Validate country-specific formats (returns Option<bool>)
// None is returned if the country is not supported or structurally invalid
let ssn_ok = ids.validate.unwrap_or;
let vat_ok = company_ids.validate.unwrap_or;
let acc_ok = bank_accounts.validate.unwrap_or;
// 3. IBAN validation
let iban_ok = validate_iban;
SDK Generation API
use thread_rng;
let mut rng = thread_rng;
// Generate with default options
let card = credit_cards.generate.unwrap;
let id = ids.generate.unwrap;
// Parse an existing ID to extract metadata
let result = ids.parse.unwrap;
println!;
Performance
Built in Rust, idsmith is designed for high-performance validation and generation, significantly outperforming interpreted alternatives in both raw throughput and CLI startup.
Validation Throughput (IBAN)
Measured on 100,000 iterations.
| Library | Language | Throughput | Relative Speed |
|---|---|---|---|
| idsmith | Rust | ~1,350,000 ops/s | 1.0x |
ibantools |
Node.js | ~490,000 ops/s | ~2.7x slower |
python-stdnum |
Python | ~53,000 ops/s | ~25x slower |
CLI Startup Overhead
Average time per command execution.
| Tool | Startup Time | Overhead |
|---|---|---|
| idsmith (Rust) | ~1ms | Baseline |
python-stdnum (Python) |
~62ms | ~60x slower |
Validation Standards
Accuracy is ensured by cross-validating against established industry libraries. Verification scripts are available in the scripts/ directory.
| Category | Validation Source |
|---|---|
| IBAN | ibantools |
| Personal ID | python-stdnum, taiwan-id |
| Bank Account | abavalidator, clabe-validator |
| Credit Card | ISO/IEC 7812 (Luhn Algorithm) |
| SWIFT/BIC | ISO 9362 Standards |
License
MIT