| 1 | package Business::IBAN::Database; | ||
| 2 | 3 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 3 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 3 | our $VERSION = 0.095; # Release of the document | |
| 6 | |||
| 7 | 3 | ▶ | use Business::IBAN::Util qw/numify_iban mod97/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 3 | ▶ | use Hash::Util 'lock_hash'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 3 | ▶ | use Exporter 'import'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 3 | our @EXPORT = qw/iban_db numify_iban mod97/; | |
| 12 | |||
| 13 | 3 | my %iban_db = ( | |
| 14 | 'AD' => { | ||
| 15 | 'country' => 'Andorra', | ||
| 16 | 'iban_length' => '24', | ||
| 17 | 'iban_structure' => 'AD[0-9]{2}[0-9]{4}[0-9]{4}[A-Za-z0-9]{12}', | ||
| 18 | 'is_sepa' => 1, | ||
| 19 | 'pattern' => 'AD2!n4!n4!n12!c' | ||
| 20 | }, | ||
| 21 | 'AE' => { | ||
| 22 | 'country' => 'United Arab Emirates (The)', | ||
| 23 | 'iban_length' => '23', | ||
| 24 | 'iban_structure' => 'AE[0-9]{2}[0-9]{3}[0-9]{16}', | ||
| 25 | 'is_sepa' => 0, | ||
| 26 | 'pattern' => 'AE2!n3!n16!n' | ||
| 27 | }, | ||
| 28 | 'AL' => { | ||
| 29 | 'country' => 'Albania', | ||
| 30 | 'iban_length' => '28', | ||
| 31 | 'iban_structure' => 'AL[0-9]{2}[0-9]{8}[A-Za-z0-9]{16}', | ||
| 32 | 'is_sepa' => 0, | ||
| 33 | 'pattern' => 'AL2!n8!n16!c' | ||
| 34 | }, | ||
| 35 | 'AT' => { | ||
| 36 | 'country' => 'Austria', | ||
| 37 | 'iban_length' => '20', | ||
| 38 | 'iban_structure' => 'AT[0-9]{2}[0-9]{5}[0-9]{11}', | ||
| 39 | 'is_sepa' => 1, | ||
| 40 | 'pattern' => 'AT2!n5!n11!n' | ||
| 41 | }, | ||
| 42 | 'AZ' => { | ||
| 43 | 'country' => 'Azerbaijan', | ||
| 44 | 'iban_length' => '28', | ||
| 45 | 'iban_structure' => 'AZ[0-9]{2}[A-Z]{4}[A-Za-z0-9]{20}', | ||
| 46 | 'is_sepa' => 0, | ||
| 47 | 'pattern' => 'AZ2!n4!a20!c' | ||
| 48 | }, | ||
| 49 | 'BA' => { | ||
| 50 | 'country' => 'Bosnia and Herzegovina', | ||
| 51 | 'iban_length' => '20', | ||
| 52 | 'iban_structure' => 'BA[0-9]{2}[0-9]{3}[0-9]{3}[0-9]{8}[0-9]{2}', | ||
| 53 | 'is_sepa' => 0, | ||
| 54 | 'pattern' => 'BA2!n3!n3!n8!n2!n' | ||
| 55 | }, | ||
| 56 | 'BE' => { | ||
| 57 | 'country' => 'Belgium', | ||
| 58 | 'iban_length' => '16', | ||
| 59 | 'iban_structure' => 'BE[0-9]{2}[0-9]{3}[0-9]{7}[0-9]{2}', | ||
| 60 | 'is_sepa' => 1, | ||
| 61 | 'pattern' => 'BE2!n3!n7!n2!n' | ||
| 62 | }, | ||
| 63 | 'BG' => { | ||
| 64 | 'country' => 'Bulgaria', | ||
| 65 | 'iban_length' => '22', | ||
| 66 | 'iban_structure' => 'BG[0-9]{2}[A-Z]{4}[0-9]{4}[0-9]{2}[A-Za-z0-9]{8}', | ||
| 67 | 'is_sepa' => 1, | ||
| 68 | 'pattern' => 'BG2!n4!a4!n2!n8!c' | ||
| 69 | }, | ||
| 70 | 'BH' => { | ||
| 71 | 'country' => 'Bahrain', | ||
| 72 | 'iban_length' => '22', | ||
| 73 | 'iban_structure' => 'BH[0-9]{2}[A-Z]{4}[A-Za-z0-9]{14}', | ||
| 74 | 'is_sepa' => 0, | ||
| 75 | 'pattern' => 'BH2!n4!a14!c' | ||
| 76 | }, | ||
| 77 | 'BI' => { | ||
| 78 | 'country' => 'Burundi', | ||
| 79 | 'iban_length' => '27', | ||
| 80 | 'iban_structure' => 'BI[0-9]{2}[0-9]{5}[0-9]{5}[0-9]{11}[0-9]{2}', | ||
| 81 | 'is_sepa' => 0, | ||
| 82 | 'pattern' => 'BI2!n5!n5!n11!n2!n' | ||
| 83 | }, | ||
| 84 | 'BR' => { | ||
| 85 | 'country' => 'Brazil', | ||
| 86 | 'iban_length' => '29', | ||
| 87 | 'iban_structure' => 'BR[0-9]{2}[0-9]{8}[0-9]{5}[0-9]{10}[A-Z]{1}[A-Za-z0-9]{1}', | ||
| 88 | 'is_sepa' => 0, | ||
| 89 | 'pattern' => 'BR2!n8!n5!n10!n1!a1!c' | ||
| 90 | }, | ||
| 91 | 'BY' => { | ||
| 92 | 'country' => 'Republic of Belarus', | ||
| 93 | 'iban_length' => '28', | ||
| 94 | 'iban_structure' => 'BY[0-9]{2}[A-Za-z0-9]{4}[0-9]{4}[A-Za-z0-9]{16}', | ||
| 95 | 'is_sepa' => 0, | ||
| 96 | 'pattern' => 'BY2!n4!c4!n16!c' | ||
| 97 | }, | ||
| 98 | 'CH' => { | ||
| 99 | 'country' => 'Switzerland', | ||
| 100 | 'iban_length' => '21', | ||
| 101 | 'iban_structure' => 'CH[0-9]{2}[0-9]{5}[A-Za-z0-9]{12}', | ||
| 102 | 'is_sepa' => 1, | ||
| 103 | 'pattern' => 'CH2!n5!n12!c' | ||
| 104 | }, | ||
| 105 | 'CR' => { | ||
| 106 | 'country' => 'Costa Rica', | ||
| 107 | 'iban_length' => '22', | ||
| 108 | 'iban_structure' => 'CR[0-9]{2}[0-9]{4}[0-9]{14}', | ||
| 109 | 'is_sepa' => 0, | ||
| 110 | 'pattern' => 'CR2!n4!n14!n' | ||
| 111 | }, | ||
| 112 | 'CY' => { | ||
| 113 | 'country' => 'Cyprus', | ||
| 114 | 'iban_length' => '28', | ||
| 115 | 'iban_structure' => 'CY[0-9]{2}[0-9]{3}[0-9]{5}[A-Za-z0-9]{16}', | ||
| 116 | 'is_sepa' => 1, | ||
| 117 | 'pattern' => 'CY2!n3!n5!n16!c' | ||
| 118 | }, | ||
| 119 | 'CZ' => { | ||
| 120 | 'country' => 'Czechia', | ||
| 121 | 'iban_length' => '24', | ||
| 122 | 'iban_structure' => 'CZ[0-9]{2}[0-9]{4}[0-9]{6}[0-9]{10}', | ||
| 123 | 'is_sepa' => 1, | ||
| 124 | 'pattern' => 'CZ2!n4!n6!n10!n' | ||
| 125 | }, | ||
| 126 | 'DE' => { | ||
| 127 | 'country' => 'Germany', | ||
| 128 | 'iban_length' => '22', | ||
| 129 | 'iban_structure' => 'DE[0-9]{2}[0-9]{8}[0-9]{10}', | ||
| 130 | 'is_sepa' => 1, | ||
| 131 | 'pattern' => 'DE2!n8!n10!n' | ||
| 132 | }, | ||
| 133 | 'DJ' => { | ||
| 134 | 'country' => 'Djibouti', | ||
| 135 | 'iban_length' => '27', | ||
| 136 | 'iban_structure' => 'DJ[0-9]{2}[0-9]{5}[0-9]{5}[0-9]{11}[0-9]{2}', | ||
| 137 | 'is_sepa' => 0, | ||
| 138 | 'pattern' => 'DJ2!n5!n5!n11!n2!n' | ||
| 139 | }, | ||
| 140 | 'DK' => { | ||
| 141 | 'country' => 'Denmark', | ||
| 142 | 'iban_length' => '18', | ||
| 143 | 'iban_structure' => 'DK[0-9]{2}[0-9]{4}[0-9]{9}[0-9]{1}', | ||
| 144 | 'is_sepa' => 1, | ||
| 145 | 'pattern' => 'DK2!n4!n9!n1!n' | ||
| 146 | }, | ||
| 147 | 'DO' => { | ||
| 148 | 'country' => 'Dominican Republic', | ||
| 149 | 'iban_length' => '28', | ||
| 150 | 'iban_structure' => 'DO[0-9]{2}[A-Za-z0-9]{4}[0-9]{20}', | ||
| 151 | 'is_sepa' => 0, | ||
| 152 | 'pattern' => 'DO2!n4!c20!n' | ||
| 153 | }, | ||
| 154 | 'EE' => { | ||
| 155 | 'country' => 'Estonia', | ||
| 156 | 'iban_length' => '20', | ||
| 157 | 'iban_structure' => 'EE[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{11}[0-9]{1}', | ||
| 158 | 'is_sepa' => 1, | ||
| 159 | 'pattern' => 'EE2!n2!n2!n11!n1!n' | ||
| 160 | }, | ||
| 161 | 'EG' => { | ||
| 162 | 'country' => 'Egypt', | ||
| 163 | 'iban_length' => '29', | ||
| 164 | 'iban_structure' => 'EG[0-9]{2}[0-9]{4}[0-9]{4}[0-9]{17}', | ||
| 165 | 'is_sepa' => 0, | ||
| 166 | 'pattern' => 'EG2!n4!n4!n17!n' | ||
| 167 | }, | ||
| 168 | 'ES' => { | ||
| 169 | 'country' => 'Spain', | ||
| 170 | 'iban_length' => '24', | ||
| 171 | 'iban_structure' => 'ES[0-9]{2}[0-9]{4}[0-9]{4}[0-9]{1}[0-9]{1}[0-9]{10}', | ||
| 172 | 'is_sepa' => 1, | ||
| 173 | 'pattern' => 'ES2!n4!n4!n1!n1!n10!n' | ||
| 174 | }, | ||
| 175 | 'FI' => { | ||
| 176 | 'country' => 'Finland', | ||
| 177 | 'iban_length' => '18', | ||
| 178 | 'iban_structure' => 'FI[0-9]{2}[0-9]{3}[0-9]{11}', | ||
| 179 | 'is_sepa' => 1, | ||
| 180 | 'pattern' => 'FI2!n3!n11!n' | ||
| 181 | }, | ||
| 182 | 'FK' => { | ||
| 183 | 'country' => 'Falkland Islands', | ||
| 184 | 'iban_length' => '18', | ||
| 185 | 'iban_structure' => 'FK[0-9]{2}[A-Z]{2}[0-9]{12}', | ||
| 186 | 'is_sepa' => 0, | ||
| 187 | 'pattern' => 'FK2!n2!a12!n' | ||
| 188 | }, | ||
| 189 | 'FO' => { | ||
| 190 | 'country' => 'Faroe Islands', | ||
| 191 | 'iban_length' => '18', | ||
| 192 | 'iban_structure' => 'FO[0-9]{2}[0-9]{4}[0-9]{9}[0-9]{1}', | ||
| 193 | 'is_sepa' => 0, | ||
| 194 | 'pattern' => 'FO2!n4!n9!n1!n' | ||
| 195 | }, | ||
| 196 | 'FR' => { | ||
| 197 | 'country' => 'France', | ||
| 198 | 'iban_length' => '27', | ||
| 199 | 'iban_structure' => 'FR[0-9]{2}[0-9]{5}[0-9]{5}[A-Za-z0-9]{11}[0-9]{2}', | ||
| 200 | 'is_sepa' => 1, | ||
| 201 | 'pattern' => 'FR2!n5!n5!n11!c2!n' | ||
| 202 | }, | ||
| 203 | 'GB' => { | ||
| 204 | 'country' => 'United Kingdom', | ||
| 205 | 'iban_length' => '22', | ||
| 206 | 'iban_structure' => 'GB[0-9]{2}[A-Z]{4}[0-9]{6}[0-9]{8}', | ||
| 207 | 'is_sepa' => 1, | ||
| 208 | 'pattern' => 'GB2!n4!a6!n8!n' | ||
| 209 | }, | ||
| 210 | 'GE' => { | ||
| 211 | 'country' => 'Georgia', | ||
| 212 | 'iban_length' => '22', | ||
| 213 | 'iban_structure' => 'GE[0-9]{2}[A-Z]{2}[0-9]{16}', | ||
| 214 | 'is_sepa' => 0, | ||
| 215 | 'pattern' => 'GE2!n2!a16!n' | ||
| 216 | }, | ||
| 217 | 'GI' => { | ||
| 218 | 'country' => 'Gibraltar', | ||
| 219 | 'iban_length' => '23', | ||
| 220 | 'iban_structure' => 'GI[0-9]{2}[A-Z]{4}[A-Za-z0-9]{15}', | ||
| 221 | 'is_sepa' => 1, | ||
| 222 | 'pattern' => 'GI2!n4!a15!c' | ||
| 223 | }, | ||
| 224 | 'GL' => { | ||
| 225 | 'country' => 'Greenland', | ||
| 226 | 'iban_length' => '18', | ||
| 227 | 'iban_structure' => 'GL[0-9]{2}[0-9]{4}[0-9]{9}[0-9]{1}', | ||
| 228 | 'is_sepa' => 0, | ||
| 229 | 'pattern' => 'GL2!n4!n9!n1!n' | ||
| 230 | }, | ||
| 231 | 'GR' => { | ||
| 232 | 'country' => 'Greece', | ||
| 233 | 'iban_length' => '27', | ||
| 234 | 'iban_structure' => 'GR[0-9]{2}[0-9]{3}[0-9]{4}[A-Za-z0-9]{16}', | ||
| 235 | 'is_sepa' => 1, | ||
| 236 | 'pattern' => 'GR2!n3!n4!n16!c' | ||
| 237 | }, | ||
| 238 | 'GT' => { | ||
| 239 | 'country' => 'Guatemala', | ||
| 240 | 'iban_length' => '28', | ||
| 241 | 'iban_structure' => 'GT[0-9]{2}[A-Za-z0-9]{4}[A-Za-z0-9]{20}', | ||
| 242 | 'is_sepa' => 0, | ||
| 243 | 'pattern' => 'GT2!n4!c20!c' | ||
| 244 | }, | ||
| 245 | 'HR' => { | ||
| 246 | 'country' => 'Croatia', | ||
| 247 | 'iban_length' => '21', | ||
| 248 | 'iban_structure' => 'HR[0-9]{2}[0-9]{7}[0-9]{10}', | ||
| 249 | 'is_sepa' => 1, | ||
| 250 | 'pattern' => 'HR2!n7!n10!n' | ||
| 251 | }, | ||
| 252 | 'HU' => { | ||
| 253 | 'country' => 'Hungary', | ||
| 254 | 'iban_length' => '28', | ||
| 255 | 'iban_structure' => 'HU[0-9]{2}[0-9]{3}[0-9]{4}[0-9]{1}[0-9]{15}[0-9]{1}', | ||
| 256 | 'is_sepa' => 1, | ||
| 257 | 'pattern' => 'HU2!n3!n4!n1!n15!n1!n' | ||
| 258 | }, | ||
| 259 | 'IE' => { | ||
| 260 | 'country' => 'Ireland', | ||
| 261 | 'iban_length' => '22', | ||
| 262 | 'iban_structure' => 'IE[0-9]{2}[A-Z]{4}[0-9]{6}[0-9]{8}', | ||
| 263 | 'is_sepa' => 1, | ||
| 264 | 'pattern' => 'IE2!n4!a6!n8!n' | ||
| 265 | }, | ||
| 266 | 'IL' => { | ||
| 267 | 'country' => 'Israel', | ||
| 268 | 'iban_length' => '23', | ||
| 269 | 'iban_structure' => 'IL[0-9]{2}[0-9]{3}[0-9]{3}[0-9]{13}', | ||
| 270 | 'is_sepa' => 0, | ||
| 271 | 'pattern' => 'IL2!n3!n3!n13!n' | ||
| 272 | }, | ||
| 273 | 'IQ' => { | ||
| 274 | 'country' => 'Iraq', | ||
| 275 | 'iban_length' => '23', | ||
| 276 | 'iban_structure' => 'IQ[0-9]{2}[A-Z]{4}[0-9]{3}[0-9]{12}', | ||
| 277 | 'is_sepa' => 0, | ||
| 278 | 'pattern' => 'IQ2!n4!a3!n12!n' | ||
| 279 | }, | ||
| 280 | 'IS' => { | ||
| 281 | 'country' => 'Iceland', | ||
| 282 | 'iban_length' => '26', | ||
| 283 | 'iban_structure' => 'IS[0-9]{2}[0-9]{4}[0-9]{2}[0-9]{6}[0-9]{10}', | ||
| 284 | 'is_sepa' => 0, | ||
| 285 | 'pattern' => 'IS2!n4!n2!n6!n10!n' | ||
| 286 | }, | ||
| 287 | 'IT' => { | ||
| 288 | 'country' => 'Italy', | ||
| 289 | 'iban_length' => '27', | ||
| 290 | 'iban_structure' => 'IT[0-9]{2}[A-Z]{1}[0-9]{5}[0-9]{5}[A-Za-z0-9]{12}', | ||
| 291 | 'is_sepa' => 1, | ||
| 292 | 'pattern' => 'IT2!n1!a5!n5!n12!c' | ||
| 293 | }, | ||
| 294 | 'JO' => { | ||
| 295 | 'country' => 'Jordan', | ||
| 296 | 'iban_length' => '30', | ||
| 297 | 'iban_structure' => 'JO[0-9]{2}[A-Z]{4}[0-9]{4}[A-Za-z0-9]{18}', | ||
| 298 | 'is_sepa' => 0, | ||
| 299 | 'pattern' => 'JO2!n4!a4!n18!c' | ||
| 300 | }, | ||
| 301 | 'KW' => { | ||
| 302 | 'country' => 'Kuwait', | ||
| 303 | 'iban_length' => '30', | ||
| 304 | 'iban_structure' => 'KW[0-9]{2}[A-Z]{4}[A-Za-z0-9]{22}', | ||
| 305 | 'is_sepa' => 0, | ||
| 306 | 'pattern' => 'KW2!n4!a22!c' | ||
| 307 | }, | ||
| 308 | 'KZ' => { | ||
| 309 | 'country' => 'Kazakhstan', | ||
| 310 | 'iban_length' => '20', | ||
| 311 | 'iban_structure' => 'KZ[0-9]{2}[0-9]{3}[A-Za-z0-9]{13}', | ||
| 312 | 'is_sepa' => 0, | ||
| 313 | 'pattern' => 'KZ2!n3!n13!c' | ||
| 314 | }, | ||
| 315 | 'LB' => { | ||
| 316 | 'country' => 'Lebanon', | ||
| 317 | 'iban_length' => '28', | ||
| 318 | 'iban_structure' => 'LB[0-9]{2}[0-9]{4}[A-Za-z0-9]{20}', | ||
| 319 | 'is_sepa' => 0, | ||
| 320 | 'pattern' => 'LB2!n4!n20!c' | ||
| 321 | }, | ||
| 322 | 'LC' => { | ||
| 323 | 'country' => 'Saint Lucia', | ||
| 324 | 'iban_length' => '32', | ||
| 325 | 'iban_structure' => 'LC[0-9]{2}[A-Z]{4}[A-Za-z0-9]{24}', | ||
| 326 | 'is_sepa' => 0, | ||
| 327 | 'pattern' => 'LC2!n4!a24!c' | ||
| 328 | }, | ||
| 329 | 'LI' => { | ||
| 330 | 'country' => 'Liechtenstein', | ||
| 331 | 'iban_length' => '21', | ||
| 332 | 'iban_structure' => 'LI[0-9]{2}[0-9]{5}[A-Za-z0-9]{12}', | ||
| 333 | 'is_sepa' => 1, | ||
| 334 | 'pattern' => 'LI2!n5!n12!c' | ||
| 335 | }, | ||
| 336 | 'LT' => { | ||
| 337 | 'country' => 'Lithuania', | ||
| 338 | 'iban_length' => '20', | ||
| 339 | 'iban_structure' => 'LT[0-9]{2}[0-9]{5}[0-9]{11}', | ||
| 340 | 'is_sepa' => 1, | ||
| 341 | 'pattern' => 'LT2!n5!n11!n' | ||
| 342 | }, | ||
| 343 | 'LU' => { | ||
| 344 | 'country' => 'Luxembourg', | ||
| 345 | 'iban_length' => '20', | ||
| 346 | 'iban_structure' => 'LU[0-9]{2}[0-9]{3}[A-Za-z0-9]{13}', | ||
| 347 | 'is_sepa' => 1, | ||
| 348 | 'pattern' => 'LU2!n3!n13!c' | ||
| 349 | }, | ||
| 350 | 'LV' => { | ||
| 351 | 'country' => 'Latvia', | ||
| 352 | 'iban_length' => '21', | ||
| 353 | 'iban_structure' => 'LV[0-9]{2}[A-Z]{4}[A-Za-z0-9]{13}', | ||
| 354 | 'is_sepa' => 1, | ||
| 355 | 'pattern' => 'LV2!n4!a13!c' | ||
| 356 | }, | ||
| 357 | 'LY' => { | ||
| 358 | 'country' => 'Libya', | ||
| 359 | 'iban_length' => '25', | ||
| 360 | 'iban_structure' => 'LY[0-9]{2}[0-9]{3}[0-9]{3}[0-9]{15}', | ||
| 361 | 'is_sepa' => 0, | ||
| 362 | 'pattern' => 'LY2!n3!n3!n15!n' | ||
| 363 | }, | ||
| 364 | 'MC' => { | ||
| 365 | 'country' => 'Monaco', | ||
| 366 | 'iban_length' => '27', | ||
| 367 | 'iban_structure' => 'MC[0-9]{2}[0-9]{5}[0-9]{5}[A-Za-z0-9]{11}[0-9]{2}', | ||
| 368 | 'is_sepa' => 1, | ||
| 369 | 'pattern' => 'MC2!n5!n5!n11!c2!n' | ||
| 370 | }, | ||
| 371 | 'MD' => { | ||
| 372 | 'country' => 'Moldova', | ||
| 373 | 'iban_length' => '24', | ||
| 374 | 'iban_structure' => 'MD[0-9]{2}[A-Za-z0-9]{2}[A-Za-z0-9]{18}', | ||
| 375 | 'is_sepa' => 0, | ||
| 376 | 'pattern' => 'MD2!n2!c18!c' | ||
| 377 | }, | ||
| 378 | 'ME' => { | ||
| 379 | 'country' => 'Montenegro', | ||
| 380 | 'iban_length' => '22', | ||
| 381 | 'iban_structure' => 'ME[0-9]{2}[0-9]{3}[0-9]{13}[0-9]{2}', | ||
| 382 | 'is_sepa' => 0, | ||
| 383 | 'pattern' => 'ME2!n3!n13!n2!n' | ||
| 384 | }, | ||
| 385 | 'MK' => { | ||
| 386 | 'country' => 'Macedonia', | ||
| 387 | 'iban_length' => '19', | ||
| 388 | 'iban_structure' => 'MK[0-9]{2}[0-9]{3}[A-Za-z0-9]{10}[0-9]{2}', | ||
| 389 | 'is_sepa' => 0, | ||
| 390 | 'pattern' => 'MK2!n3!n10!c2!n' | ||
| 391 | }, | ||
| 392 | 'MN' => { | ||
| 393 | 'country' => 'Mongolia', | ||
| 394 | 'iban_length' => '20', | ||
| 395 | 'iban_structure' => 'MN[0-9]{2}[0-9]{4}[0-9]{12}', | ||
| 396 | 'is_sepa' => 0, | ||
| 397 | 'pattern' => 'MN2!n4!n12!n' | ||
| 398 | }, | ||
| 399 | 'MR' => { | ||
| 400 | 'country' => 'Mauritania', | ||
| 401 | 'iban_length' => '27', | ||
| 402 | 'iban_structure' => 'MR[0-9]{2}[0-9]{5}[0-9]{5}[0-9]{11}[0-9]{2}', | ||
| 403 | 'is_sepa' => 0, | ||
| 404 | 'pattern' => 'MR2!n5!n5!n11!n2!n' | ||
| 405 | }, | ||
| 406 | 'MT' => { | ||
| 407 | 'country' => 'Malta', | ||
| 408 | 'iban_length' => '31', | ||
| 409 | 'iban_structure' => 'MT[0-9]{2}[A-Z]{4}[0-9]{5}[A-Za-z0-9]{18}', | ||
| 410 | 'is_sepa' => 1, | ||
| 411 | 'pattern' => 'MT2!n4!a5!n18!c' | ||
| 412 | }, | ||
| 413 | 'MU' => { | ||
| 414 | 'country' => 'Mauritius', | ||
| 415 | 'iban_length' => '30', | ||
| 416 | 'iban_structure' => 'MU[0-9]{2}[A-Z]{4}[0-9]{2}[0-9]{2}[0-9]{12}[0-9]{3}[A-Z]{3}', | ||
| 417 | 'is_sepa' => 0, | ||
| 418 | 'pattern' => 'MU2!n4!a2!n2!n12!n3!n3!a' | ||
| 419 | }, | ||
| 420 | 'NI' => { | ||
| 421 | 'country' => 'Nicaragua', | ||
| 422 | 'iban_length' => '28', | ||
| 423 | 'iban_structure' => 'NI[0-9]{2}[A-Z]{4}[0-9]{20}', | ||
| 424 | 'is_sepa' => 0, | ||
| 425 | 'pattern' => 'NI2!n4!a20!n' | ||
| 426 | }, | ||
| 427 | 'NL' => { | ||
| 428 | 'country' => 'Netherlands (The)', | ||
| 429 | 'iban_length' => '18', | ||
| 430 | 'iban_structure' => 'NL[0-9]{2}[A-Z]{4}[0-9]{10}', | ||
| 431 | 'is_sepa' => 1, | ||
| 432 | 'pattern' => 'NL2!n4!a10!n' | ||
| 433 | }, | ||
| 434 | 'NO' => { | ||
| 435 | 'country' => 'Norway', | ||
| 436 | 'iban_length' => '15', | ||
| 437 | 'iban_structure' => 'NO[0-9]{2}[0-9]{4}[0-9]{6}[0-9]{1}', | ||
| 438 | 'is_sepa' => 1, | ||
| 439 | 'pattern' => 'NO2!n4!n6!n1!n' | ||
| 440 | }, | ||
| 441 | 'PK' => { | ||
| 442 | 'country' => 'Pakistan', | ||
| 443 | 'iban_length' => '24', | ||
| 444 | 'iban_structure' => 'PK[0-9]{2}[A-Z]{4}[A-Za-z0-9]{16}', | ||
| 445 | 'is_sepa' => 0, | ||
| 446 | 'pattern' => 'PK2!n4!a16!c' | ||
| 447 | }, | ||
| 448 | 'PL' => { | ||
| 449 | 'country' => 'Poland', | ||
| 450 | 'iban_length' => '28', | ||
| 451 | 'iban_structure' => 'PL[0-9]{2}[0-9]{8}[0-9]{16}', | ||
| 452 | 'is_sepa' => 1, | ||
| 453 | 'pattern' => 'PL2!n8!n16!n' | ||
| 454 | }, | ||
| 455 | 'PS' => { | ||
| 456 | 'country' => '"Palestine, State of"', | ||
| 457 | 'iban_length' => '29', | ||
| 458 | 'iban_structure' => 'PS[0-9]{2}[A-Z]{4}[A-Za-z0-9]{21}', | ||
| 459 | 'is_sepa' => 0, | ||
| 460 | 'pattern' => 'PS2!n4!a21!c' | ||
| 461 | }, | ||
| 462 | 'PT' => { | ||
| 463 | 'country' => 'Portugal', | ||
| 464 | 'iban_length' => '25', | ||
| 465 | 'iban_structure' => 'PT[0-9]{2}[0-9]{4}[0-9]{4}[0-9]{11}[0-9]{2}', | ||
| 466 | 'is_sepa' => 1, | ||
| 467 | 'pattern' => 'PT2!n4!n4!n11!n2!n' | ||
| 468 | }, | ||
| 469 | 'QA' => { | ||
| 470 | 'country' => 'Qatar', | ||
| 471 | 'iban_length' => '29', | ||
| 472 | 'iban_structure' => 'QA[0-9]{2}[A-Z]{4}[A-Za-z0-9]{21}', | ||
| 473 | 'is_sepa' => 0, | ||
| 474 | 'pattern' => 'QA2!n4!a21!c' | ||
| 475 | }, | ||
| 476 | 'RO' => { | ||
| 477 | 'country' => 'Romania', | ||
| 478 | 'iban_length' => '24', | ||
| 479 | 'iban_structure' => 'RO[0-9]{2}[A-Z]{4}[A-Za-z0-9]{16}', | ||
| 480 | 'is_sepa' => 1, | ||
| 481 | 'pattern' => 'RO2!n4!a16!c' | ||
| 482 | }, | ||
| 483 | 'RS' => { | ||
| 484 | 'country' => 'Serbia', | ||
| 485 | 'iban_length' => '22', | ||
| 486 | 'iban_structure' => 'RS[0-9]{2}[0-9]{3}[0-9]{13}[0-9]{2}', | ||
| 487 | 'is_sepa' => 0, | ||
| 488 | 'pattern' => 'RS2!n3!n13!n2!n' | ||
| 489 | }, | ||
| 490 | 'RU' => { | ||
| 491 | 'country' => 'Russia', | ||
| 492 | 'iban_length' => '33', | ||
| 493 | 'iban_structure' => 'RU[0-9]{2}[0-9]{9}[0-9]{5}[A-Za-z0-9]{15}', | ||
| 494 | 'is_sepa' => 0, | ||
| 495 | 'pattern' => 'RU2!n9!n5!n15!c' | ||
| 496 | }, | ||
| 497 | 'SA' => { | ||
| 498 | 'country' => 'Saudi Arabia', | ||
| 499 | 'iban_length' => '24', | ||
| 500 | 'iban_structure' => 'SA[0-9]{2}[0-9]{2}[A-Za-z0-9]{18}', | ||
| 501 | 'is_sepa' => 0, | ||
| 502 | 'pattern' => 'SA2!n2!n18!c' | ||
| 503 | }, | ||
| 504 | 'SC' => { | ||
| 505 | 'country' => 'Seychelles', | ||
| 506 | 'iban_length' => '31', | ||
| 507 | 'iban_structure' => 'SC[0-9]{2}[A-Z]{4}[0-9]{2}[0-9]{2}[0-9]{16}[A-Z]{3}', | ||
| 508 | 'is_sepa' => 0, | ||
| 509 | 'pattern' => 'SC2!n4!a2!n2!n16!n3!a' | ||
| 510 | }, | ||
| 511 | 'SD' => { | ||
| 512 | 'country' => 'Sudan', | ||
| 513 | 'iban_length' => '18', | ||
| 514 | 'iban_structure' => 'SD[0-9]{2}[0-9]{2}[0-9]{12}', | ||
| 515 | 'is_sepa' => 0, | ||
| 516 | 'pattern' => 'SD2!n2!n12!n' | ||
| 517 | }, | ||
| 518 | 'SE' => { | ||
| 519 | 'country' => 'Sweden', | ||
| 520 | 'iban_length' => '24', | ||
| 521 | 'iban_structure' => 'SE[0-9]{2}[0-9]{3}[0-9]{16}[0-9]{1}', | ||
| 522 | 'is_sepa' => 1, | ||
| 523 | 'pattern' => 'SE2!n3!n16!n1!n' | ||
| 524 | }, | ||
| 525 | 'SI' => { | ||
| 526 | 'country' => 'Slovenia', | ||
| 527 | 'iban_length' => '19', | ||
| 528 | 'iban_structure' => 'SI[0-9]{2}[0-9]{5}[0-9]{8}[0-9]{2}', | ||
| 529 | 'is_sepa' => 1, | ||
| 530 | 'pattern' => 'SI2!n5!n8!n2!n' | ||
| 531 | }, | ||
| 532 | 'SK' => { | ||
| 533 | 'country' => 'Slovakia', | ||
| 534 | 'iban_length' => '24', | ||
| 535 | 'iban_structure' => 'SK[0-9]{2}[0-9]{4}[0-9]{6}[0-9]{10}', | ||
| 536 | 'is_sepa' => 1, | ||
| 537 | 'pattern' => 'SK2!n4!n6!n10!n' | ||
| 538 | }, | ||
| 539 | 'SM' => { | ||
| 540 | 'country' => 'San Marino', | ||
| 541 | 'iban_length' => '27', | ||
| 542 | 'iban_structure' => 'SM[0-9]{2}[A-Z]{1}[0-9]{5}[0-9]{5}[A-Za-z0-9]{12}', | ||
| 543 | 'is_sepa' => 1, | ||
| 544 | 'pattern' => 'SM2!n1!a5!n5!n12!c' | ||
| 545 | }, | ||
| 546 | 'SO' => { | ||
| 547 | 'country' => 'Somalia', | ||
| 548 | 'iban_length' => '23', | ||
| 549 | 'iban_structure' => 'SO[0-9]{2}[0-9]{4}[0-9]{3}[0-9]{12}', | ||
| 550 | 'is_sepa' => 0, | ||
| 551 | 'pattern' => 'SO2!n4!n3!n12!n' | ||
| 552 | }, | ||
| 553 | 'ST' => { | ||
| 554 | 'country' => 'Sao Tome and Principe', | ||
| 555 | 'iban_length' => '25', | ||
| 556 | 'iban_structure' => 'ST[0-9]{2}[0-9]{4}[0-9]{4}[0-9]{11}[0-9]{2}', | ||
| 557 | 'is_sepa' => 0, | ||
| 558 | 'pattern' => 'ST2!n4!n4!n11!n2!n' | ||
| 559 | }, | ||
| 560 | 'SV' => { | ||
| 561 | 'country' => 'El Salvador', | ||
| 562 | 'iban_length' => '28', | ||
| 563 | 'iban_structure' => 'SV[0-9]{2}[A-Z]{4}[0-9]{20}', | ||
| 564 | 'is_sepa' => 0, | ||
| 565 | 'pattern' => 'SV2!n4!a20!n' | ||
| 566 | }, | ||
| 567 | 'TL' => { | ||
| 568 | 'country' => 'Timor-Leste', | ||
| 569 | 'iban_length' => '23', | ||
| 570 | 'iban_structure' => 'TL[0-9]{2}[0-9]{3}[0-9]{14}[0-9]{2}', | ||
| 571 | 'is_sepa' => 0, | ||
| 572 | 'pattern' => 'TL2!n3!n14!n2!n' | ||
| 573 | }, | ||
| 574 | 'TN' => { | ||
| 575 | 'country' => 'Tunisia', | ||
| 576 | 'iban_length' => '24', | ||
| 577 | 'iban_structure' => 'TN[0-9]{2}[0-9]{2}[0-9]{3}[0-9]{13}[0-9]{2}', | ||
| 578 | 'is_sepa' => 0, | ||
| 579 | 'pattern' => 'TN2!n2!n3!n13!n2!n' | ||
| 580 | }, | ||
| 581 | 'TR' => { | ||
| 582 | 'country' => 'Turkey', | ||
| 583 | 'iban_length' => '26', | ||
| 584 | 'iban_structure' => 'TR[0-9]{2}[0-9]{5}[0-9]{1}[A-Za-z0-9]{16}', | ||
| 585 | 'is_sepa' => 0, | ||
| 586 | 'pattern' => 'TR2!n5!n1!n16!c' | ||
| 587 | }, | ||
| 588 | 'UA' => { | ||
| 589 | 'country' => 'Ukraine', | ||
| 590 | 'iban_length' => '29', | ||
| 591 | 'iban_structure' => 'UA[0-9]{2}[0-9]{6}[A-Za-z0-9]{19}', | ||
| 592 | 'is_sepa' => 0, | ||
| 593 | 'pattern' => 'UA2!n6!n19!c' | ||
| 594 | }, | ||
| 595 | 'VA' => { | ||
| 596 | 'country' => 'Vatican City State', | ||
| 597 | 'iban_length' => '22', | ||
| 598 | 'iban_structure' => 'VA[0-9]{2}[0-9]{3}[0-9]{15}', | ||
| 599 | 'is_sepa' => 1, | ||
| 600 | 'pattern' => 'VA2!n3!n15!n' | ||
| 601 | }, | ||
| 602 | 'VG' => { | ||
| 603 | 'country' => 'Virgin Islands', | ||
| 604 | 'iban_length' => '24', | ||
| 605 | 'iban_structure' => 'VG[0-9]{2}[A-Z]{4}[0-9]{16}', | ||
| 606 | 'is_sepa' => 0, | ||
| 607 | 'pattern' => 'VG2!n4!a16!n' | ||
| 608 | } | ||
| 609 | ); | ||
| 610 | |||
| 611 | 2 | ▶ | sub iban_db { |
|
Subroutine
iban_db: called CC=1 SCAR=0.0
Pod
documented
| |||
| 612 | 2 | lock_hash(%iban_db); | |
| 613 | 2 | return \%iban_db; | |
| 614 | } | ||
| 615 | |||
| 616 | 3 | 1; | |
| 617 | |||
| 618 | =head1 NAME | ||
| 619 | |||
| 620 | Business::IBAN::Database - Simple database for checking IBANs | ||
| 621 | |||
| 622 | =head1 SYNOPSIS | ||
| 623 | |||
| 624 | use Business::IBAN::Database; | ||
| 625 | |||
| 626 | my $iso3166a2 = uc substr $iban, 0, 2; | ||
| 627 | if (!exists iban_db->{$iso3166a2}) { | ||
| 628 | die "Countrycode '$iso3166a2' not in IBAN.\n"; | ||
| 629 | } | ||
| 630 | if (length($iban) != iban_db->{$iso3166a2}{iban_length}) { | ||
| 631 | die "Invalid length for '$iban'.\n"; | ||
| 632 | } | ||
| 633 | if ($iban !~ iban_db->{$iso3166a2}{iban_structure}) { | ||
| 634 | die "Invalid pattern for '$iban'.\n"; | ||
| 635 | } | ||
| 636 | if (mod97(numify_iban($iban)) != 1) { | ||
| 637 | die "Invalid checksum for '$iban'.\n"; | ||
| 638 | } | ||
| 639 | |||
| 640 | =head1 DESCRIPTION | ||
| 641 | |||
| 642 | This module was generated from the F<swift_iban_registry_0.txt> document supplied by | ||
| 643 | SWIFT version 93 February 2023 (also F<swift_iban_registry_v93.pdf>). | ||
| 644 | |||
| 645 | All functions are exported by default. | ||
| 646 | |||
| 647 | =head2 iban_db() | ||
| 648 | |||
| 649 | Returns a reference to the "database" of known IBAN entities, keyed on the | ||
| 650 | two letter code for participating countries (See ISO 3166 alpha 2 codes). | ||
| 651 | |||
| 652 | =head1 COPYRIGHT | ||
| 653 | |||
| 654 | E<copy> MMXXIII - Abe Timmerman <abeltje@cpan.org> | ||
| 655 | |||
| 656 | =head1 LICENSE | ||
| 657 | |||
| 658 | This library is free software; you can redistribute it and/or modify | ||
| 659 | it under the same terms as Perl itself. | ||
| 660 | |||
| 661 | This program is distributed in the hope that it will be useful, | ||
| 662 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 663 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
| 664 | |||
| 665 | =cut | ||