https://github.com/skwasjer/IbanNet
C# .NET IBAN validator, parser, builder and generator
https://github.com/skwasjer/IbanNet
builder c-sharp csharp dotnet dotnet-core dotnet-standard generator iban iban-validator parser validator
Last synced: 9 months ago
JSON representation
C# .NET IBAN validator, parser, builder and generator
- Host: GitHub
- URL: https://github.com/skwasjer/IbanNet
- Owner: skwasjer
- License: apache-2.0
- Created: 2017-12-25T00:17:03.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2025-04-09T16:12:02.000Z (10 months ago)
- Last Synced: 2025-04-10T06:38:46.823Z (10 months ago)
- Topics: builder, c-sharp, csharp, dotnet, dotnet-core, dotnet-standard, generator, iban, iban-validator, parser, validator
- Language: C#
- Homepage:
- Size: 2.02 MB
- Stars: 143
- Watchers: 8
- Forks: 33
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Support: SupportedCountries.md
Awesome Lists containing this project
README
# IbanNet 
IbanNet is a .NET library providing functionality to validate and parse an [International Bank Account Number](https://en.wikipedia.org/wiki/International_Bank_Account_Number) also known as IBAN.
Additionally, IbanNet provides:
- the `Iban` primitive type, which can be used as a drop in replacement for a `string` in your domain.
- a builder to construct IBAN's from a Basic Bank Account Number (BBAN).
- a generator to assist with (unit) testing.
---
[](https://stand-with-ukraine.pp.ua)
[](https://github.com/skwasjer/IbanNet/actions/workflows/main.yml)
[](https://sonarcloud.io/summary/new_code?id=skwasjer_IbanNet)
[](https://sonarcloud.io/component_measures?id=skwasjer_IbanNet&metric=coverage)
| | | |
|---|---|---|
| `IbanNet` | [](https://www.nuget.org/packages/IbanNet/) [](https://www.nuget.org/packages/IbanNet/) | [Documentation](../../wiki)
| `IbanNet.DataAnnotations` | [](https://www.nuget.org/packages/IbanNet.DataAnnotations/) [](https://www.nuget.org/packages/IbanNet.DataAnnotations/) | [Documentation](../../wiki/IbanNet.DataAnnotations) |
| `IbanNet.DependencyInjection.Autofac` | [](https://www.nuget.org/packages/IbanNet.DependencyInjection.Autofac/) [](https://www.nuget.org/packages/IbanNet.DependencyInjection.Autofac/) | [Documentation](../../wiki/Dependency-injection) |
| `IbanNet.DependencyInjection.ServiceProvider` | [](https://www.nuget.org/packages/IbanNet.DependencyInjection.ServiceProvider/) [](https://www.nuget.org/packages/IbanNet.DependencyInjection.ServiceProvider/) | [Documentation](../../wiki/Dependency-injection) |
| `IbanNet.FluentValidation` | [](https://www.nuget.org/packages/IbanNet.FluentValidation/) [](https://www.nuget.org/packages/IbanNet.FluentValidation/) | [Documentation](../../wiki/IbanNet.FluentValidation) |
## Example with validator
```csharp
IIbanValidator validator = new IbanValidator();
ValidationResult validationResult = validator.Validate("NL91ABNA0417164300");
if (validationResult.IsValid)
{
// ..
}
```
## Example with `Iban` type
```csharp
Iban iban;
IIbanParser parser = new IbanParser(IbanRegistry.Default);
bool success = parser.TryParse("NL91 ABNA 0417 1643 00", out iban);
if (success)
{
Console.WriteLine(iban.ToString(IbanFormat.Obfuscated)); // XXXXXXXXXXXXXX4300
}
```
### Contributions
Please check out the [contribution guidelines](./CONTRIBUTING.md).
### Other info
- [Changelog](./CHANGELOG.md)
- [IbanNet supported countries](SupportedCountries.md)
- [Fiddle](https://dotnetfiddle.net/JeGa9x)