arturmkrtchyan / iban4j

A Java library for generation and validation of the International Bank Account Numbers (IBAN ISO_13616) and Business Identifier Codes (BIC ISO_9362).
http://iban4j.org
Apache License 2.0
270 stars 124 forks source link

open Builder for subtypes #143

Open bastie opened 1 month ago

bastie commented 1 month ago

Hello, nice project.

Please do not Iban.Builder as final and declare fillMissingFieldsRandomly as protected, because generation of random Iban are rare correct with more checks. For example:

Germanys IBAN checksum maybe correct, but in 100_000 random cycles generates less than 10 times "more" correct IBAN. German IBAN contains the old Bankleitzahl after the checksum. The Bundesbank provides 4 times a year a list of valid Bankleitzahl. And so today's random generate IBAN for CountryCode DE is rare valid. The Bankleitzahl is not the only check for German IBAN, because after that number came the Kontonummer and the Kontonummer include also a checksum depending of Bankleitzahl before. See https://www.bundesbank.de/de/aufgaben/unbarer-zahlungsverkehr/serviceangebot/iban-regeln

If you open the Iban.Builder more accurate random build can be direct implemented.

with regards

hajk1 commented 1 month ago

Hello @bastie, thanks for your comment. I'll consider your points.