Laravel for Rust Alpha
laravel-rust-iban
Validate, format and inspect IBANs in Rust and Laravel for Rust.
Rust port of globalcitizen/php-iban: IBAN validation, formatting, parsing, national checksums, and country registry data for Laravel for Rust.
Read the docs Source on GitHub
cargo add laravel-rust-iban- Latest release
- 0.1.0, 2026-12-05
- Maintenance
- Active
- Framework
- laravel-rust 0.2.x
- MSRV
- Rust 1.99 or later
- Licence
- MIT
PHP parity
Follows globalcitizen/php-iban v5.03b (commit 9f4538ec9077). Last verified .
- Parity level
- Core
- Abilities
- 59
- Covered
- 14
- Diverged
- 34
- Planned
- 11
- PHP fixtures
- 565
Fixtures are generated by PHP itself: PHP 8.4, globalcitizen/php-iban v5.03b.
Coverage by ability
-
iban.verify· Diverged · Coreverify_iban($iban, false) / IBAN::Verify() -
iban.verify.machine_format_only· Diverged · Coreverify_iban($iban, true) / IBAN::VerifyMachineFormatOnly() -
iban.format.machine· Covered · Core · 2 testsiban_to_machine_format($iban) / IBAN::MachineFormat() -
iban.format.human· Covered · Core · 2 testsiban_to_human_format($iban) / IBAN::HumanFormat() -
iban.format.obfuscated· Diverged · Coreiban_to_obfuscated_format($iban) / IBAN::ObfuscatedFormat() -
iban.checksum.verify· Diverged · Coreiban_verify_checksum($iban) / IBAN::VerifyChecksum() -
iban.checksum.find· Diverged · Coreiban_find_checksum($iban) / IBAN::FindChecksum() -
iban.checksum.set· Diverged · Coreiban_set_checksum($iban) / IBAN::SetChecksum() -
iban.checksum.string_replace· Covered · 2 testsiban_checksum_string_replace($s) / IBAN::ChecksumStringReplace() -
iban.checksum.mod97_10· Covered · 2 testsiban_mod97_10($numeric_representation) -
iban.checksum.mod97_10_checksum· Covered · 2 testsiban_mod97_10_checksum($numeric_representation) -
iban.config.disable_gmp· DivergedPHP GMP arithmetic backend toggle -
iban.parts.all· Diverged · Coreiban_get_parts($iban) / IBAN::Parts() -
iban.parts.country· Covered · Core · 2 testsiban_get_country_part($iban) / IBAN::Country() -
iban.parts.checksum· Covered · Core · 2 testsiban_get_checksum_part($iban) / IBAN::Checksum() -
iban.parts.bban· Covered · Core · 2 testsiban_get_bban_part($iban) / IBAN::BBAN() -
iban.parts.bank· Diverged · Coreiban_get_bank_part($iban) / IBAN::Bank() -
iban.parts.branch· Diverged · Coreiban_get_branch_part($iban) / IBAN::Branch() -
iban.parts.account· Diverged · Coreiban_get_account_part($iban) / IBAN::Account() -
iban.parts.national_checksum· Diverged · Coreiban_get_nationalchecksum_part($iban) / IBAN::NationalChecksum() -
iban.national_checksum.verify· Diverged · Coreiban_verify_nationalchecksum($iban) / IBAN::VerifyNationalChecksum() -
iban.national_checksum.find· Divergediban_find_nationalchecksum($iban) / IBAN::FindNationalChecksum() -
iban.national_checksum.set· Divergediban_set_nationalchecksum($iban) / IBAN::SetNationalChecksum() -
iban.national_checksum.be· Diverged · CoreNational checksum for Belgium (BE) -
iban.national_checksum.es· Covered · 2 testsNational checksum for Spain (ES) -
iban.national_checksum.fr_rib· DivergedNational checksum for France RIB scheme (FR, MC, UEMOA, CEMAC) -
iban.national_checksum.it_cin· Covered · 2 testsNational checksum for Italy and San Marino (IT, SM) -
iban.national_checksum.mod97_10· DivergedNational checksum for ISO 7064 MOD 97-10 countries (ME, MK, PT, RS, SI, TL) -
iban.national_checksum.nl· DivergedNational checksum for Netherlands (NL 11-proof, INGB exception) -
iban.national_checksum.no· DivergedNational checksum for Norway (NO Mod 11) -
iban.national_checksum.sk· DivergedNational checksum for Slovakia (SK Mod 11 verify-only) -
iban.mistranscription.suggestions· Divergediban_mistranscription_suggestions($iban) / IBAN::MistranscriptionSuggestions() -
iban.country.list· Diverged · Coreiban_countries() / IBAN::Countries() -
iban.country.name· Covered · Core · 2 testsiban_country_get_country_name($code) / IBANCountry::Name() -
iban.country.domestic_example· Plannediban_country_get_domestic_example($code) / IBANCountry::DomesticExample() -
iban.country.bban_example· Plannediban_country_get_bban_example($code) / IBANCountry::BBANExample() -
iban.country.bban_format_swift· Divergediban_country_get_bban_format_swift($code) / IBANCountry::BBANFormatSWIFT() -
iban.country.bban_format_regex· Divergediban_country_get_bban_format_regex($code) / IBANCountry::BBANFormatRegex() -
iban.country.bban_length· Diverged · Coreiban_country_get_bban_length($code) / IBANCountry::BBANLength() -
iban.country.iban_example· Plannediban_country_get_iban_example($code) / IBANCountry::IBANExample() -
iban.country.iban_format_swift· Divergediban_country_get_iban_format_swift($code) / IBANCountry::IBANFormatSWIFT() -
iban.country.iban_format_regex· Divergediban_country_get_iban_format_regex($code) / IBANCountry::IBANFormatRegex() -
iban.country.iban_length· Covered · Core · 2 testsiban_country_get_iban_length($code) / IBANCountry::IBANLength() -
iban.country.bank_id_offsets· Divergediban_country_get_bankid_start_offset / stop_offset / IBANCountry::BankID* -
iban.country.branch_id_offsets· Divergediban_country_get_branchid_start_offset / stop_offset / IBANCountry::BranchID* -
iban.country.national_checksum_offsets· Divergediban_country_get_nationalchecksum_start_offset / stop_offset / IBANCountry::NationalChecksum* -
iban.country.registry_edition· Plannediban_country_get_registry_edition($code) / IBANCountry::RegistryEdition() -
iban.country.swift_official· Covered · 2 testsiban_country_get_country_swift_official($code) / IBANCountry::SWIFTOfficial() -
iban.country.is_sepa· Diverged · Coreiban_country_is_sepa($code) / IBANCountry::IsSEPA() -
iban.country.iana· Plannediban_country_get_iana($code) / IBANCountry::IANA() -
iban.country.iso3166· Plannediban_country_get_iso3166($code) / IBANCountry::ISO3166() -
iban.country.parent_registrar· Plannediban_country_get_parent_registrar($code) / IBANCountry::ParentRegistrar() -
iban.country.currency_iso4217· Plannediban_country_get_currency_iso4217($code) / IBANCountry::CurrencyISO4217() -
iban.country.central_bank_url· Plannediban_country_get_central_bank_url($code) / IBANCountry::CentralBankURL() -
iban.country.central_bank_name· Plannediban_country_get_central_bank_name($code) / IBANCountry::CentralBankName() -
iban.country.membership· Plannediban_country_get_membership($code) / IBANCountry::Membership() -
iban.country.is_eu_member· Covered · 2 testsiban_country_get_is_eu_member($code) / IBANCountry::IsEuMember() -
iban.oo.iban_wrapper· DivergedPHP_IBAN\IBAN -
iban.oo.country_wrapper· DivergedPHP_IBAN\IBANCountry
Differences from PHP (34)
verify_iban($iban, false) / IBAN::Verify()- Validation enforces Release 103, canonical international check digits and a 1024-byte raw limit.
verify_iban($iban, true) / IBAN::VerifyMachineFormatOnly()- Electronic input uses uppercase ASCII and Release 103 BBAN classes, including the Brazilian, Qatari and Salvadoran differences.
iban_to_obfuscated_format($iban) / IBAN::ObfuscatedFormat()- Inputs shorter than six electronic characters return a length error instead of duplicating visible digits.
iban_verify_checksum($iban) / IBAN::VerifyChecksum()- Rejects an international check digit pair outside 02 through 98.
iban_find_checksum($iban) / IBAN::FindChecksum()- Returns a length error for empty input and a structure error for a malformed prefix.
iban_set_checksum($iban) / IBAN::SetChecksum()- Returns a length error for empty input instead of appending the pair 98.
PHP GMP arithmetic backend toggle- Uses one bounded streaming MOD 97-10 implementation without a GMP switch.
iban_get_parts($iban) / IBAN::Parts()- Uses the registered Release 103 bank, branch and account ranges, as recorded in the offset audit.
iban_get_bank_part($iban) / IBAN::Bank()- Uses the Release 103 bank range in the offset audit for countries with different PHP ranges.
iban_get_branch_part($iban) / IBAN::Branch()- Uses the Release 103 branch range and represents an absent branch with None.
iban_get_account_part($iban) / IBAN::Account()- Derives the account from the Release 103 ranges, including the bank-adjacent slice where no branch is registered.
iban_get_nationalchecksum_part($iban) / IBAN::NationalChecksum()- Returns an explicit national check digit slice only, including None for the verified Slovak account segments.
iban_verify_nationalchecksum($iban) / IBAN::VerifyNationalChecksum()- Returns a typed verdict, with canonical keys and the documented country-specific checks and exemptions.
iban_find_nationalchecksum($iban) / IBAN::FindNationalChecksum()- Returns a fixed-width string for explicit check digits and a typed error when calculation is unsupported.
iban_set_nationalchecksum($iban) / IBAN::SetNationalChecksum()- Repairs both check digit pairs when supported and reports a typed error when the supplied account cannot be repaired.
National checksum for Belgium (BE)- Follows TR201 by returning 97 for remainder zero and padding every single-digit remainder.
National checksum for France RIB scheme (FR, MC, UEMOA, CEMAC)- Implements the RIB mapping for the registered French and Monegasque formats.
National checksum for ISO 7064 MOD 97-10 countries (ME, MK, PT, RS, SI, TL)- Requires canonical national keys, checks all supported Serbian and Slovenian banks and reports unsupported for alphanumeric Macedonian accounts.
National checksum for Netherlands (NL 11-proof, INGB exception)- Uses the TR201 account-number exemption based on three leading zeros.
National checksum for Norway (NO Mod 11)- Uses the ordinary TR201 calculation and reports the separate legacy form as unsupported.
National checksum for Slovakia (SK Mod 11 verify-only)- Applies both Slovak Modulus 11 checks, including the six-digit account prefix.
iban_mistranscription_suggestions($iban) / IBAN::MistranscriptionSuggestions()- Uses an independently written visual-confusion table and returns an empty list for impossible lengths.
iban_countries() / IBAN::Countries()- Includes the 89 registered Release 103 prefixes and omits unofficial codes and unregistered aliases.
iban_country_get_bban_format_swift($code) / IBANCountry::BBANFormatSWIFT()- Uses Release 103 descriptors, including character-class differences for Brazil, Qatar and El Salvador.
iban_country_get_bban_format_regex($code) / IBANCountry::BBANFormatRegex()- Uses Release 103 descriptors, including character-class differences for Brazil, Qatar and El Salvador.
iban_country_get_bban_length($code) / IBANCountry::BBANLength()- Derives BBAN length from the registered IBAN length and returns no row for unregistered prefixes including MA.
iban_country_get_iban_format_swift($code) / IBANCountry::IBANFormatSWIFT()- Uses Release 103 descriptors, including character-class differences for Brazil, Qatar and El Salvador.
iban_country_get_iban_format_regex($code) / IBANCountry::IBANFormatRegex()- Uses Release 103 descriptors, including character-class differences for Brazil, Qatar and El Salvador.
iban_country_get_bankid_start_offset / stop_offset / IBANCountry::BankID*- Uses Release 103 bank ranges as recorded in the offset audit.
iban_country_get_branchid_start_offset / stop_offset / IBANCountry::BranchID*- Uses Release 103 branch ranges and returns None where PHP exposes an inverted or unregistered range.
iban_country_get_nationalchecksum_start_offset / stop_offset / IBANCountry::NationalChecksum*- Reports explicit national check digit ranges and omits implicit checks such as the two Slovak weighted checks.
iban_country_is_sepa($code) / IBANCountry::IsSEPA()- Uses EPC409-09 v8.0 for SEPA status across the supported registry instead of PHP's snapshot.
PHP_IBAN\IBAN- Validated Iban methods operate on their receiver, with immutable repair through the typed API.
PHP_IBAN\IBANCountry- Exposes typed registry records by reference and defers the supplemental getters listed in the first release scope.
Built on
- globalcitizen/php-iban: Reference behavior for the independent Rust implementation.
Crates: laravel-rust-iban, laravel-rust-iban-core
· Upstream notices
Documentation
- OverviewRust port of globalcitizen/php-iban: IBAN validation, formatting, parsing, national checksums, and country registry data for Laravel for Rust.
- Getting startedThis page shows how to add laravel-rust-iban to a project, validate a pasted IBAN and handle the errors.
- Working with IBANsThis page covers lenient and strict parsing, the three output formats, an IBAN's parts, the MOD 97-10 check digit helpers and typo suggestions.
- National check digitsMany countries put their own check digits inside the BBAN. Rust helpers verify, compute and repair them.
- CountriesThe IBAN country registry provides electronic lengths, BBAN structure, identifier ranges and SEPA and EU status.
- Validation and templatesThe laravel-rust-iban crate adds an IbanRule for Laravel validation and template filters that format IBANs in MiniJinja views.
- Migrating from PHPThis page lists each globalcitizen/php-iban call and its Rust equivalent, for code moving from PHP.
- ChangelogWhat changed in each release of laravel-rust-iban: additions, changes and fixes.