https://github.com/nalukit/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).
https://github.com/nalukit/iban4g
artur-mkrtchyan-iban4j bic gwt gwt-library iban iban4j j2cl java
Last synced: 3 months ago
JSON representation
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).
- Host: GitHub
- URL: https://github.com/nalukit/iban4g
- Owner: NaluKit
- License: apache-2.0
- Created: 2017-09-04T19:59:44.000Z (about 8 years ago)
- Default Branch: dev
- Last Pushed: 2024-01-03T07:33:59.000Z (almost 2 years ago)
- Last Synced: 2024-11-23T02:23:25.514Z (11 months ago)
- Topics: artur-mkrtchyan-iban4j, bic, gwt, gwt-library, iban, iban4j, j2cl, java
- Language: Java
- Homepage:
- Size: 313 KB
- Stars: 12
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# IBAN4G
 [](http://www.apache.org/licenses/LICENSE-2.0.html) [](https://gitter.im/Nalukit42/Lobby) [](https://github.com/NaluKit/iban4g/actions/workflows/build.yaml) [](https://maven-badges.herokuapp.com/maven-central/com.github.nalukit/iban4g)
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 hereA Java, GWT and J2CL ready library for generation and validation of the International Bank Account
Numbers (IBAN ISO_13616) and Business Identifier
Codes (BIC ISO_9362). 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](https://github.com/arturmkrtchyan/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:
```xml
io.github.nalukit
iban4g
3.0.0```
#### Module dependency:
(Only in case you are using iban4g with GWT!)
```xml
```
#### References
- [Artur Mkrtchyan's IBAN4j project](https://github.com/arturmkrtchyan/iban4j)
- [https://en.wikipedia.org/wiki/ISO_13616](https://en.wikipedia.org/wiki/ISO_13616)
- [https://en.wikipedia.org/wiki/ISO_9362](https://en.wikipedia.org/wiki/ISO_9362)
- [https://www.ecb.europa.eu/paym/retpaym/paymint/sepa/shared/pdf/iban_registry.pdf](https://www.ecb.europa.eu/paym/retpaym/paymint/sepa/shared/pdf/iban_registry.pdf)
- [https://www.swift.com/dsp/resources/documents/IBAN_Registry.pdf](https://www.swift.com/dsp/resources/documents/IBAN_Registry.pdf)
- [https://www.swift.com/resource/iban-registry-pdf](https://www.swift.com/resource/iban-registry-pdf)
- [https://bank.codes/iban/structure](https://bank.codes/iban/structure)## To get in touch with the developer
Please use the [Nalu Gitter room](https://gitter.im/Nalukit42/Lobby).
## 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`