Rust port of globalcitizen/php-iban: IBAN validation, formatting, parsing, national checksums, and country registry data for Laravel for Rust.
use laravel_rust_iban::Iban;
fn main() -> Result<(), laravel_rust_iban::Error> {
let iban = Iban::parse("be68 5390 0754 7034")?;
assert_eq!(iban.machine_format(), "BE68539007547034");
assert_eq!(iban.human_format(), "BE68 5390 0754 7034");
assert_eq!(iban.obfuscated_format(), "BE** **** **** 7034");
Ok(())
}
The package has two crates:
| Crate | What it holds |
|---|---|
laravel-rust-iban-core | The framework-free library: Iban, Country, NationalCheck, Error and the free functions. No runtime dependencies. |
laravel-rust-iban | The Laravel for Rust adapter: re-exports the core, and adds the IbanRule validation rule and the IbanServiceProvider with optional MiniJinja filters. |
Read the pages in this order:
| If you want to… | Read |
|---|---|
| Install the package and validate your first IBAN | Getting started |
| Parse, format and split IBANs, and work with check digits | Working with IBANs |
| Check Belgian, Spanish, French and other national check digits | National check digits |
| Look up a country's IBAN length, structure, SEPA status and EU membership | Countries |
| Validate request input and format IBANs in templates | Validation and templates |
| Find the Rust equivalent of a PHP call | Migrating from PHP |
The package does not port BIC handling: globalcitizen/php-iban has none.
Community package, not affiliated with Laravel.