laravel-rust-iban

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:

CrateWhat it holds
laravel-rust-iban-coreThe framework-free library: Iban, Country, NationalCheck, Error and the free functions. No runtime dependencies.
laravel-rust-ibanThe 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 IBANGetting started
Parse, format and split IBANs, and work with check digitsWorking with IBANs
Check Belgian, Spanish, French and other national check digitsNational check digits
Look up a country's IBAN length, structure, SEPA status and EU membershipCountries
Validate request input and format IBANs in templatesValidation and templates
Find the Rust equivalent of a PHP callMigrating from PHP

The package does not port BIC handling: globalcitizen/php-iban has none.

Community package, not affiliated with Laravel.