SkillAgentSearch skills...

Iban4g

A port of Artur Mkrtchyan's iban4j project so that it will work with Java, GWT or J2CL. A library for generation and validation of the International Bank Account Numbers IBAN (ISO_13616) and Business Identifier Codes BIC (ISO_9362).

Install / Use

/learn @NaluKit/Iban4g
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

IBAN4G

GWT3/J2CL compatible License Chat on Gitter Build & Deploy Maven Central

A port of Artur Mkrtchyan's iban4j project, so that it works in a pure Java project and projects using GWT or J2CL. Artur's project can be found <a href="https://github.com/arturmkrtchyan/iban4j">here</a>

A Java, GWT and J2CL ready library for generation and validation of the International Bank Account Numbers (<a href="http://en.wikipedia.org/wiki/ISO_13616" target="_blank">IBAN ISO_13616</a>) and Business Identifier Codes (<a href="http://en.wikipedia.org/wiki/ISO_9362" target="_blank">BIC ISO_9362</a>). The library can be used on the client and server side!

The library can be used in a Java-, GWT- or J2CL-environment.

Documentation and most of the classes are copied from iban4j.

Iban quick examples:

That's the way how to generate an Iban using the new keyword:

Iban iban = new Iban.Builder()
                .countryCode(CountryCode.AT)
                .bankCode("19043")
                .accountNumber("00234573201")
                .build();

and that is the way to generate an IBAN without using the new keyword:

Iban iban = Iban.builder()
                .countryCode(CountryCode.AT)
                .bankCode("19043")
                .accountNumber("00234573201")
                .build();

Creating an Iban object from String:

Iban iban = Iban.valueOf("DE89370400440532013000");

and from formatted String:

Iban iban = Iban.valueOf("DE89 3704 0044 0532 0130 00", IbanFormat.Default);

Generating a random Iban:

 // How to generate random Iban
 Iban iban = Iban.random(CountryCode.AT);
 Iban iban = Iban.random();
 Iban iban = Iban.builder()
                 .countryCode(CountryCode.AT)
                 .bankCode("19043")
                 .buildRandom();

Validating an Iban:

try {
    IbanUtil.validate("AT611904300234573201");
    IbanUtil.validate("DE89 3704 0044 0532 0130 00", IbanFormat.Default);
    // valid
} catch (IbanFormatException |
         InvalidCheckDigitException |
         UnsupportedCountryException e) {
    // invalid
}

Bic quick examples:

 //How to create Bic object from String
 Bic bic = Bic.valueOf("DEUTDEFF");


 //How to validate Bic
 try {
     BicUtil.validate("DEUTDEFF500");
     // valid
 } catch (BicFormatException e) {
     // invalid
 }

Maven dependency:

<dependency>
  <groupId>io.github.nalukit</groupId>
  <artifactId>iban4g</artifactId>
  <version>3.0.0</version>
</dependency>

Module dependency:

(Only in case you are using iban4g with GWT!)

<inherits name="com.github.nalukit.iban4g.Iban4g" />

References

To get in touch with the developer

Please use the Nalu Gitter room.

Notes

In case you find a bug, please open an issue.

License

Copyright 2015 Artur Mkrtchyan

Modifications Copyright 2020 Frank Hossfeld

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

Migration to io.github

Migration to the new namespace is quite simple. There only to things to do:

  1. change the groupId from com.github.nalukit to ìo.github.nalukit
  2. replace all imports from import com.github.nalukit to import io.github.nalukit
View on GitHub
GitHub Stars14
CategoryDevelopment
Updated7mo ago
Forks0

Languages

Java

Security Score

87/100

Audited on Aug 13, 2025

No findings