1 module iban;
2 
3 import std.json;
4 import std.stdio;
5 import std.algorithm;
6 import std.array;
7 import std.conv : to;
8 import form = std.format;
9 
10 struct BBan {
11     string type;
12     long count;
13 
14     string toString() const {
15         return form.format("BBan(\"%s\", %s)", this.type, this.count);
16     }
17 }
18 
19 struct IbanFormat {
20     string country;
21     long total;
22     BBan[] bban;
23     string format;
24 
25     string toString() const {
26         return form.format("IbanFormat(\"%s\", %d, \n\t\t[\n\t\t\t%s\n\t\t], \n\t\t\"%s\"\n\t)",
27                 this.country,
28                 this.total,
29                 this.bban.map!(a => a.toString()).joiner(",\n\t\t\t"),
30                 this.format
31             );
32     }
33 }
34 
35 struct IbanData {
36     char[] alpha;
37     string[] pattern10;
38     string[] pattern100;
39     IbanFormat[] formats;
40     string[] iso3166;
41 
42     string toString() const {
43         return form.format(
44             "IbanData(\n\t\tto!(dchar[])(\"%s\"),\n\t\t%s,\n\t\t%s,\n\t[\n\t%s\n\t],\n\t%s)",
45             this.alpha,
46             this.pattern10,
47             this.pattern100,
48             this.formats.map!(a => a.toString()).joiner(",\n\t"),
49             this.iso3166);
50     }
51 }
52 
53 IbanData parseIbanData() {
54     string[] splitIntoString(JSONValue v) {
55         string[] ret;
56         if(v.type == JSONType.array) {
57             JSONValue[] alpha = v.array();
58             foreach(it; alpha) {
59                 ret ~= it.str();
60             }
61         }
62         return ret;
63     }
64 
65     IbanData ret;
66     JSONValue data = parseJSON(ibanData);
67     foreach(string key, JSONValue value; data) {
68         switch(key) {
69             case "alpha":
70                 ret.alpha = splitIntoString(value).map!(a => a[0]).to!(char[]);
71                 break;
72             case "pattern10":
73                 ret.pattern10 = splitIntoString(value);
74                 break;
75             case "pattern100":
76                 ret.pattern100 = splitIntoString(value);
77                 break;
78             case "iso3166":
79                 ret.iso3166 = splitIntoString(value);
80                 break;
81             case "formats":
82                 if(value.type == JSONType.array) {
83                     JSONValue[] alpha = value.array();
84                     foreach(it; alpha) {
85                         IbanFormat ibf;
86                         foreach(string itKey, itValue; it) {
87                             switch(itKey) {
88                                 case "country":
89                                     ibf.country = itValue.str();
90                                     break;
91                                 case "total":
92                                     ibf.total = itValue.integer();
93                                     break;
94                                 case "bban":
95                                     foreach(jt; itValue.array()) {
96                                         BBan bban;
97                                         foreach(string jtKey, jtValue; jt) {
98                                             switch(jtKey) {
99                                                 case "type":
100                                                     bban.type = jtValue.str();
101                                                     break;
102                                                 case "count":
103                                                     bban.count =
104                                                         jtValue.integer();
105                                                     break;
106                                                 default:
107                                                     assert(false, jtKey);
108                                             }
109                                         }
110                                         ibf.bban ~= bban;
111                                     }
112                                     break;
113                                 case "format":
114                                     ibf.format = itValue.str;
115                                     break;
116                                 default:
117                                     assert(false, itKey);
118                             }
119                         }
120                         ret.formats ~= ibf;
121                     }
122                 }
123                 break;
124             default:
125                 assert(false, key);
126         }
127     }
128     return ret;
129 }
130 
131 string buildIbanData() {
132     import std.format : format;
133     IbanData d = parseIbanData();
134     return format("%s\n", d);
135 }
136 
137 // created by copying faker.js/lib/iban.js
138 // than use regex to make valid json %s/([a-zA-Z][a-zA-Z0-9]*):/\1:/g
139 // %s/'/"/g
140 enum string ibanData = `{
141   "alpha": [
142     "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"
143   ],
144   "pattern10": [
145     "01", "02", "03", "04", "05", "06", "07", "08", "09"
146   ],
147   "pattern100": [
148     "001", "002", "003", "004", "005", "006", "007", "008", "009"
149   ],
150   "formats": [
151     {
152       "country": "AL",
153       "total": 28,
154       "bban": [
155         {
156           "type": "n",
157           "count": 8
158         },
159         {
160           "type": "c",
161           "count": 16
162         }
163       ],
164       "format": "ALkk bbbs sssx cccc cccc cccc cccc"
165     },
166     {
167       "country": "AD",
168       "total": 24,
169       "bban": [
170         {
171           "type": "n",
172           "count": 8
173         },
174         {
175           "type": "c",
176           "count": 12
177         }
178       ],
179       "format": "ADkk bbbb ssss cccc cccc cccc"
180     },
181     {
182       "country": "AT",
183       "total": 20,
184       "bban": [
185         {
186           "type": "n",
187           "count": 5
188         },
189         {
190           "type": "n",
191           "count": 11
192         }
193       ],
194       "format": "ATkk bbbb bccc cccc cccc"
195     },
196     {
197       "country": "AZ",
198       "total": 28,
199       "bban": [
200         {
201           "type": "c",
202           "count": 4
203         },
204         {
205           "type": "n",
206           "count": 20
207         }
208       ],
209       "format": "AZkk bbbb cccc cccc cccc cccc cccc"
210     },
211     {
212       "country": "BH",
213       "total": 22,
214       "bban": [
215         {
216           "type": "a",
217           "count": 4
218         },
219         {
220           "type": "c",
221           "count": 14
222         }
223       ],
224       "format": "BHkk bbbb cccc cccc cccc cc"
225     },
226     {
227       "country": "BE",
228       "total": 16,
229       "bban": [
230         {
231           "type": "n",
232           "count": 3
233         },
234         {
235           "type": "n",
236           "count": 9
237         }
238       ],
239       "format": "BEkk bbbc cccc ccxx"
240     },
241     {
242       "country": "BA",
243       "total": 20,
244       "bban": [
245         {
246           "type": "n",
247           "count": 6
248         },
249         {
250           "type": "n",
251           "count": 10
252         }
253       ],
254       "format": "BAkk bbbs sscc cccc ccxx"
255     },
256     {
257       "country": "BR",
258       "total": 29,
259       "bban": [
260         {
261           "type": "n",
262           "count": 13
263         },
264         {
265           "type": "n",
266           "count": 10
267         },
268         {
269           "type": "a",
270           "count": 1
271         },
272         {
273           "type": "c",
274           "count": 1
275         }
276       ],
277       "format": "BRkk bbbb bbbb ssss sccc cccc ccct n"
278     },
279     {
280       "country": "BG",
281       "total": 22,
282       "bban": [
283         {
284           "type": "a",
285           "count": 4
286         },
287         {
288           "type": "n",
289           "count": 6
290         },
291         {
292           "type": "c",
293           "count": 8
294         }
295       ],
296       "format": "BGkk bbbb ssss ddcc cccc cc"
297     },
298     {
299       "country": "CR",
300       "total": 21,
301       "bban": [
302         {
303           "type": "n",
304           "count": 3
305         },
306         {
307           "type": "n",
308           "count": 14
309         }
310       ],
311       "format": "CRkk bbbc cccc cccc cccc c"
312     },
313     {
314       "country": "HR",
315       "total": 21,
316       "bban": [
317         {
318           "type": "n",
319           "count": 7
320         },
321         {
322           "type": "n",
323           "count": 10
324         }
325       ],
326       "format": "HRkk bbbb bbbc cccc cccc c"
327     },
328     {
329       "country": "CY",
330       "total": 28,
331       "bban": [
332         {
333           "type": "n",
334           "count": 8
335         },
336         {
337           "type": "c",
338           "count": 16
339         }
340       ],
341       "format": "CYkk bbbs ssss cccc cccc cccc cccc"
342     },
343     {
344       "country": "CZ",
345       "total": 24,
346       "bban": [
347         {
348           "type": "n",
349           "count": 10
350         },
351         {
352           "type": "n",
353           "count": 10
354         }
355       ],
356       "format": "CZkk bbbb ssss sscc cccc cccc"
357     },
358     {
359       "country": "DK",
360       "total": 18,
361       "bban": [
362         {
363           "type": "n",
364           "count": 4
365         },
366         {
367           "type": "n",
368           "count": 10
369         }
370       ],
371       "format": "DKkk bbbb cccc cccc cc"
372     },
373     {
374       "country": "DO",
375       "total": 28,
376       "bban": [
377         {
378           "type": "a",
379           "count": 4
380         },
381         {
382           "type": "n",
383           "count": 20
384         }
385       ],
386       "format": "DOkk bbbb cccc cccc cccc cccc cccc"
387     },
388     {
389       "country": "TL",
390       "total": 23,
391       "bban": [
392         {
393           "type": "n",
394           "count": 3
395         },
396         {
397           "type": "n",
398           "count": 16
399         }
400       ],
401       "format": "TLkk bbbc cccc cccc cccc cxx"
402     },
403     {
404       "country": "EE",
405       "total": 20,
406       "bban": [
407         {
408           "type": "n",
409           "count": 4
410         },
411         {
412           "type": "n",
413           "count": 12
414         }
415       ],
416       "format": "EEkk bbss cccc cccc cccx"
417     },
418     {
419       "country": "FO",
420       "total": 18,
421       "bban": [
422         {
423           "type": "n",
424           "count": 4
425         },
426         {
427           "type": "n",
428           "count": 10
429         }
430       ],
431       "format": "FOkk bbbb cccc cccc cx"
432     },
433     {
434       "country": "FI",
435       "total": 18,
436       "bban": [
437         {
438           "type": "n",
439           "count": 6
440         },
441         {
442           "type": "n",
443           "count": 8
444         }
445       ],
446       "format": "FIkk bbbb bbcc cccc cx"
447     },
448     {
449       "country": "FR",
450       "total": 27,
451       "bban": [
452         {
453           "type": "n",
454           "count": 10
455         },
456         {
457           "type": "c",
458           "count": 11
459         },
460         {
461           "type": "n",
462           "count": 2
463         }
464       ],
465       "format": "FRkk bbbb bggg ggcc cccc cccc cxx"
466     },
467     {
468       "country": "GE",
469       "total": 22,
470       "bban": [
471         {
472           "type": "c",
473           "count": 2
474         },
475         {
476           "type": "n",
477           "count": 16
478         }
479       ],
480       "format": "GEkk bbcc cccc cccc cccc cc"
481     },
482     {
483       "country": "DE",
484       "total": 22,
485       "bban": [
486         {
487           "type": "n",
488           "count": 8
489         },
490         {
491           "type": "n",
492           "count": 10
493         }
494       ],
495       "format": "DEkk bbbb bbbb cccc cccc cc"
496     },
497     {
498       "country": "GI",
499       "total": 23,
500       "bban": [
501         {
502           "type": "a",
503           "count": 4
504         },
505         {
506           "type": "c",
507           "count": 15
508         }
509       ],
510       "format": "GIkk bbbb cccc cccc cccc ccc"
511     },
512     {
513       "country": "GR",
514       "total": 27,
515       "bban": [
516         {
517           "type": "n",
518           "count": 7
519         },
520         {
521           "type": "c",
522           "count": 16
523         }
524       ],
525       "format": "GRkk bbbs sssc cccc cccc cccc ccc"
526     },
527     {
528       "country": "GL",
529       "total": 18,
530       "bban": [
531         {
532           "type": "n",
533           "count": 4
534         },
535         {
536           "type": "n",
537           "count": 10
538         }
539       ],
540       "format": "GLkk bbbb cccc cccc cc"
541     },
542     {
543       "country": "GT",
544       "total": 28,
545       "bban": [
546         {
547           "type": "c",
548           "count": 4
549         },
550         {
551           "type": "c",
552           "count": 4
553         },
554         {
555           "type": "c",
556           "count": 16
557         }
558       ],
559       "format": "GTkk bbbb mmtt cccc cccc cccc cccc"
560     },
561     {
562       "country": "HU",
563       "total": 28,
564       "bban": [
565         {
566           "type": "n",
567           "count": 8
568         },
569         {
570           "type": "n",
571           "count": 16
572         }
573       ],
574       "format": "HUkk bbbs sssk cccc cccc cccc cccx"
575     },
576     {
577       "country": "IS",
578       "total": 26,
579       "bban": [
580         {
581           "type": "n",
582           "count": 6
583         },
584         {
585           "type": "n",
586           "count": 16
587         }
588       ],
589       "format": "ISkk bbbb sscc cccc iiii iiii ii"
590     },
591     {
592       "country": "IE",
593       "total": 22,
594       "bban": [
595         {
596           "type": "c",
597           "count": 4
598         },
599         {
600           "type": "n",
601           "count": 6
602         },
603         {
604           "type": "n",
605           "count": 8
606         }
607       ],
608       "format": "IEkk aaaa bbbb bbcc cccc cc"
609     },
610     {
611       "country": "IL",
612       "total": 23,
613       "bban": [
614         {
615           "type": "n",
616           "count": 6
617         },
618         {
619           "type": "n",
620           "count": 13
621         }
622       ],
623       "format": "ILkk bbbn nncc cccc cccc ccc"
624     },
625     {
626       "country": "IT",
627       "total": 27,
628       "bban": [
629         {
630           "type": "a",
631           "count": 1
632         },
633         {
634           "type": "n",
635           "count": 10
636         },
637         {
638           "type": "c",
639           "count": 12
640         }
641       ],
642       "format": "ITkk xaaa aabb bbbc cccc cccc ccc"
643     },
644     {
645       "country": "JO",
646       "total": 30,
647       "bban": [
648         {
649           "type": "a",
650           "count": 4
651         },
652         {
653           "type": "n",
654           "count": 4
655         },
656         {
657           "type": "n",
658           "count": 18
659         }
660       ],
661       "format": "JOkk bbbb nnnn cccc cccc cccc cccc cc"
662     },
663     {
664       "country": "KZ",
665       "total": 20,
666       "bban": [
667         {
668           "type": "n",
669           "count": 3
670         },
671         {
672           "type": "c",
673           "count": 13
674         }
675       ],
676       "format": "KZkk bbbc cccc cccc cccc"
677     },
678     {
679       "country": "XK",
680       "total": 20,
681       "bban": [
682         {
683           "type": "n",
684           "count": 4
685         },
686         {
687           "type": "n",
688           "count": 12
689         }
690       ],
691       "format": "XKkk bbbb cccc cccc cccc"
692     },
693     {
694       "country": "KW",
695       "total": 30,
696       "bban": [
697         {
698           "type": "a",
699           "count": 4
700         },
701         {
702           "type": "c",
703           "count": 22
704         }
705       ],
706       "format": "KWkk bbbb cccc cccc cccc cccc cccc cc"
707     },
708     {
709       "country": "LV",
710       "total": 21,
711       "bban": [
712         {
713           "type": "a",
714           "count": 4
715         },
716         {
717           "type": "c",
718           "count": 13
719         }
720       ],
721       "format": "LVkk bbbb cccc cccc cccc c"
722     },
723     {
724       "country": "LB",
725       "total": 28,
726       "bban": [
727         {
728           "type": "n",
729           "count": 4
730         },
731         {
732           "type": "c",
733           "count": 20
734         }
735       ],
736       "format": "LBkk bbbb cccc cccc cccc cccc cccc"
737     },
738     {
739       "country": "LI",
740       "total": 21,
741       "bban": [
742         {
743           "type": "n",
744           "count": 5
745         },
746         {
747           "type": "c",
748           "count": 12
749         }
750       ],
751       "format": "LIkk bbbb bccc cccc cccc c"
752     },
753     {
754       "country": "LT",
755       "total": 20,
756       "bban": [
757         {
758           "type": "n",
759           "count": 5
760         },
761         {
762           "type": "n",
763           "count": 11
764         }
765       ],
766       "format": "LTkk bbbb bccc cccc cccc"
767     },
768     {
769       "country": "LU",
770       "total": 20,
771       "bban": [
772         {
773           "type": "n",
774           "count": 3
775         },
776         {
777           "type": "c",
778           "count": 13
779         }
780       ],
781       "format": "LUkk bbbc cccc cccc cccc"
782     },
783     {
784       "country": "MK",
785       "total": 19,
786       "bban": [
787         {
788           "type": "n",
789           "count": 3
790         },
791         {
792           "type": "c",
793           "count": 10
794         },
795         {
796           "type": "n",
797           "count": 2
798         }
799       ],
800       "format": "MKkk bbbc cccc cccc cxx"
801     },
802     {
803       "country": "MT",
804       "total": 31,
805       "bban": [
806         {
807           "type": "a",
808           "count": 4
809         },
810         {
811           "type": "n",
812           "count": 5
813         },
814         {
815           "type": "c",
816           "count": 18
817         }
818       ],
819       "format": "MTkk bbbb ssss sccc cccc cccc cccc ccc"
820     },
821     {
822       "country": "MR",
823       "total": 27,
824       "bban": [
825         {
826           "type": "n",
827           "count": 10
828         },
829         {
830           "type": "n",
831           "count": 13
832         }
833       ],
834       "format": "MRkk bbbb bsss sscc cccc cccc cxx"
835     },
836     {
837       "country": "MU",
838       "total": 30,
839       "bban": [
840         {
841           "type": "a",
842           "count": 4
843         },
844         {
845           "type": "n",
846           "count": 4
847         },
848         {
849           "type": "n",
850           "count": 15
851         },
852         {
853           "type": "a",
854           "count": 3
855         }
856       ],
857       "format": "MUkk bbbb bbss cccc cccc cccc 000d dd"
858     },
859     {
860       "country": "MC",
861       "total": 27,
862       "bban": [
863         {
864           "type": "n",
865           "count": 10
866         },
867         {
868           "type": "c",
869           "count": 11
870         },
871         {
872           "type": "n",
873           "count": 2
874         }
875       ],
876       "format": "MCkk bbbb bsss sscc cccc cccc cxx"
877     },
878     {
879       "country": "MD",
880       "total": 24,
881       "bban": [
882         {
883           "type": "c",
884           "count": 2
885         },
886         {
887           "type": "c",
888           "count": 18
889         }
890       ],
891       "format": "MDkk bbcc cccc cccc cccc cccc"
892     },
893     {
894       "country": "ME",
895       "total": 22,
896       "bban": [
897         {
898           "type": "n",
899           "count": 3
900         },
901         {
902           "type": "n",
903           "count": 15
904         }
905       ],
906       "format": "MEkk bbbc cccc cccc cccc xx"
907     },
908     {
909       "country": "NL",
910       "total": 18,
911       "bban": [
912         {
913           "type": "a",
914           "count": 4
915         },
916         {
917           "type": "n",
918           "count": 10
919         }
920       ],
921       "format": "NLkk bbbb cccc cccc cc"
922     },
923     {
924       "country": "NO",
925       "total": 15,
926       "bban": [
927         {
928           "type": "n",
929           "count": 4
930         },
931         {
932           "type": "n",
933           "count": 7
934         }
935       ],
936       "format": "NOkk bbbb cccc ccx"
937     },
938     {
939       "country": "PK",
940       "total": 24,
941       "bban": [
942         {
943           "type": "c",
944           "count": 4
945         },
946         {
947           "type": "n",
948           "count": 16
949         }
950       ],
951       "format": "PKkk bbbb cccc cccc cccc cccc"
952     },
953     {
954       "country": "PS",
955       "total": 29,
956       "bban": [
957         {
958           "type": "c",
959           "count": 4
960         },
961         {
962           "type": "n",
963           "count": 9
964         },
965         {
966           "type": "n",
967           "count": 12
968         }
969       ],
970       "format": "PSkk bbbb xxxx xxxx xccc cccc cccc c"
971     },
972     {
973       "country": "PL",
974       "total": 28,
975       "bban": [
976         {
977           "type": "n",
978           "count": 8
979         },
980         {
981           "type": "n",
982           "count": 16
983         }
984       ],
985       "format": "PLkk bbbs sssx cccc cccc cccc cccc"
986     },
987     {
988       "country": "PT",
989       "total": 25,
990       "bban": [
991         {
992           "type": "n",
993           "count": 8
994         },
995         {
996           "type": "n",
997           "count": 13
998         }
999       ],
1000       "format": "PTkk bbbb ssss cccc cccc cccx x"
1001     },
1002     {
1003       "country": "QA",
1004       "total": 29,
1005       "bban": [
1006         {
1007           "type": "a",
1008           "count": 4
1009         },
1010         {
1011           "type": "c",
1012           "count": 21
1013         }
1014       ],
1015       "format": "QAkk bbbb cccc cccc cccc cccc cccc c"
1016     },
1017     {
1018       "country": "RO",
1019       "total": 24,
1020       "bban": [
1021         {
1022           "type": "a",
1023           "count": 4
1024         },
1025         {
1026           "type": "c",
1027           "count": 16
1028         }
1029       ],
1030       "format": "ROkk bbbb cccc cccc cccc cccc"
1031     },
1032     {
1033       "country": "SM",
1034       "total": 27,
1035       "bban": [
1036         {
1037           "type": "a",
1038           "count": 1
1039         },
1040         {
1041           "type": "n",
1042           "count": 10
1043         },
1044         {
1045           "type": "c",
1046           "count": 12
1047         }
1048       ],
1049       "format": "SMkk xaaa aabb bbbc cccc cccc ccc"
1050     },
1051     {
1052       "country": "SA",
1053       "total": 24,
1054       "bban": [
1055         {
1056           "type": "n",
1057           "count": 2
1058         },
1059         {
1060           "type": "c",
1061           "count": 18
1062         }
1063       ],
1064       "format": "SAkk bbcc cccc cccc cccc cccc"
1065     },
1066     {
1067       "country": "RS",
1068       "total": 22,
1069       "bban": [
1070         {
1071           "type": "n",
1072           "count": 3
1073         },
1074         {
1075           "type": "n",
1076           "count": 15
1077         }
1078       ],
1079       "format": "RSkk bbbc cccc cccc cccc xx"
1080     },
1081     {
1082       "country": "SK",
1083       "total": 24,
1084       "bban": [
1085         {
1086           "type": "n",
1087           "count": 10
1088         },
1089         {
1090           "type": "n",
1091           "count": 10
1092         }
1093       ],
1094       "format": "SKkk bbbb ssss sscc cccc cccc"
1095     },
1096     {
1097       "country": "SI",
1098       "total": 19,
1099       "bban": [
1100         {
1101           "type": "n",
1102           "count": 5
1103         },
1104         {
1105           "type": "n",
1106           "count": 10
1107         }
1108       ],
1109       "format": "SIkk bbss sccc cccc cxx"
1110     },
1111     {
1112       "country": "ES",
1113       "total": 24,
1114       "bban": [
1115         {
1116           "type": "n",
1117           "count": 10
1118         },
1119         {
1120           "type": "n",
1121           "count": 10
1122         }
1123       ],
1124       "format": "ESkk bbbb gggg xxcc cccc cccc"
1125     },
1126     {
1127       "country": "SE",
1128       "total": 24,
1129       "bban": [
1130         {
1131           "type": "n",
1132           "count": 3
1133         },
1134         {
1135           "type": "n",
1136           "count": 17
1137         }
1138       ],
1139       "format": "SEkk bbbc cccc cccc cccc cccc"
1140     },
1141     {
1142       "country": "CH",
1143       "total": 21,
1144       "bban": [
1145         {
1146           "type": "n",
1147           "count": 5
1148         },
1149         {
1150           "type": "c",
1151           "count": 12
1152         }
1153       ],
1154       "format": "CHkk bbbb bccc cccc cccc c"
1155     },
1156     {
1157       "country": "TN",
1158       "total": 24,
1159       "bban": [
1160         {
1161           "type": "n",
1162           "count": 5
1163         },
1164         {
1165           "type": "n",
1166           "count": 15
1167         }
1168       ],
1169       "format": "TNkk bbss sccc cccc cccc cccc"
1170     },
1171     {
1172       "country": "TR",
1173       "total": 26,
1174       "bban": [
1175         {
1176           "type": "n",
1177           "count": 5
1178         },
1179         {
1180           "type": "c",
1181           "count": 1
1182         },
1183         {
1184           "type": "c",
1185           "count": 16
1186         }
1187       ],
1188       "format": "TRkk bbbb bxcc cccc cccc cccc cc"
1189     },
1190     {
1191       "country": "AE",
1192       "total": 23,
1193       "bban": [
1194         {
1195           "type": "n",
1196           "count": 3
1197         },
1198         {
1199           "type": "n",
1200           "count": 16
1201         }
1202       ],
1203       "format": "AEkk bbbc cccc cccc cccc ccc"
1204     },
1205     {
1206       "country": "GB",
1207       "total": 22,
1208       "bban": [
1209         {
1210           "type": "a",
1211           "count": 4
1212         },
1213         {
1214           "type": "n",
1215           "count": 6
1216         },
1217         {
1218           "type": "n",
1219           "count": 8
1220         }
1221       ],
1222       "format": "GBkk bbbb ssss sscc cccc cc"
1223     },
1224     {
1225       "country": "VG",
1226       "total": 24,
1227       "bban": [
1228         {
1229           "type": "c",
1230           "count": 4
1231         },
1232         {
1233           "type": "n",
1234           "count": 16
1235         }
1236       ],
1237       "format": "VGkk bbbb cccc cccc cccc cccc"
1238     }
1239   ],
1240   "iso3166": [
1241     "AC", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AN", "AO", "AQ", "AR", "AS",
1242     "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI",
1243     "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BU", "BV", "BW", "BY",
1244     "BZ", "CA", "CC", "CD", "CE", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN",
1245     "CO", "CP", "CR", "CS", "CS", "CU", "CV", "CW", "CX", "CY", "CZ", "DD", "DE",
1246     "DG", "DJ", "DK", "DM", "DO", "DZ", "EA", "EC", "EE", "EG", "EH", "ER", "ES",
1247     "ET", "EU", "FI", "FJ", "FK", "FM", "FO", "FR", "FX", "GA", "GB", "GD", "GE",
1248     "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU",
1249     "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "IC", "ID", "IE", "IL", "IM",
1250     "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH",
1251     "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK",
1252     "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH",
1253     "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW",
1254     "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR",
1255     "NT", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN",
1256     "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB",
1257     "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR",
1258     "SS", "ST", "SU", "SV", "SX", "SY", "SZ", "TA", "TC", "TD", "TF", "TG", "TH",
1259     "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG",
1260     "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS",
1261     "YE", "YT", "YU", "ZA", "ZM", "ZR", "ZW"
1262   ]
1263 }`;