https://github.com/close2/iban
A validation library for ibans.
https://github.com/close2/iban
dart iban-validator
Last synced: about 1 month ago
JSON representation
A validation library for ibans.
- Host: GitHub
- URL: https://github.com/close2/iban
- Owner: close2
- License: bsd-3-clause
- Created: 2017-02-14T10:04:56.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2024-10-27T18:05:29.000Z (over 1 year ago)
- Last Synced: 2025-11-27T17:11:52.959Z (4 months ago)
- Topics: dart, iban-validator
- Language: Dart
- Size: 43.9 KB
- Stars: 4
- Watchers: 2
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# iban
Validate IBANs

## Usage
A simple usage example:
```dart
import 'package:iban/iban.dart';
void main() {
final iban = 'at61 1904 3002 3457 3201';
if (isValid(iban)) {
print('$iban is a valid iban');
} else {
print('$iban is not a valid iban');
}
if (isValid(iban, sanitize: false)) {
print('$iban without sanitization is a valid iban.');
} else {
print('$iban without sanitization is not a valid iban.');
}
print('Convert the IBAN into a standard format: ${electronicFormat(iban)}');
print('To display an IBAN to a user we have: ${toPrintFormat(iban)}');
}
```
## Iban specifications
The iban specifications are copied from [iban.js](https://github.com/arhs/iban.js/blob/master/iban.js), which is unfortunately no longer maintained.
See [specifications.dart](tool/specifications.dart) for all available countries.
Contrary to `iban.js`, which parses the specifications at runtime, all regular expression
strings are parsed using [specifications_builder.dart](tool/specifications_builder.dart).
Please open an issue if you know how to build the iban for another country.