NAME

Business::IBAN::Database - Simple database for checking IBANs

SYNOPSIS

use Business::IBAN::Database;

my $iso3166a2 = uc substr $iban, 0, 2;
if (!exists iban_db->{$iso3166a2}) {
    die "Countrycode '$iso3166a2' not in IBAN.\n";
}
if (length($iban) != iban_db->{$iso3166a2}{iban_length}) {
    die "Invalid length for '$iban'.\n";
}
if ($iban !~ iban_db->{$iso3166a2}{iban_structure}) {
    die "Invalid pattern for '$iban'.\n";
}
if (mod97(numify_iban($iban)) != 1) {
    die "Invalid checksum for '$iban'.\n";
}

DESCRIPTION

This module was generated from the swift_iban_registry_0.txt document supplied by SWIFT version 93 February 2023 (also swift_iban_registry_v93.pdf).

All functions are exported by default.

iban_db()

Returns a reference to the "database" of known IBAN entities, keyed on the two letter code for participating countries (See ISO 3166 alpha 2 codes).

COPYRIGHT

© MMXXIII - Abe Timmerman <abeltje@cpan.org>

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.