IbanNet
IbanNet is a .NET library providing functionality to validate and parse an 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 astring
in your domain. - a builder to construct IBAN's from a Basic Bank Account Number (BBAN).
- a generator to assist with (unit) testing.
IbanNet |
Documentation | |
IbanNet.DataAnnotations |
Documentation | |
IbanNet.DependencyInjection.Autofac |
Documentation | |
IbanNet.DependencyInjection.ServiceProvider |
Documentation | |
IbanNet.FluentValidation |
Documentation |
Example with validator
IIbanValidator validator = new IbanValidator();
ValidationResult validationResult = validator.Validate("NL91ABNA0417164300");
if (validationResult.IsValid)
{
// ..
}
Iban
type
Example with 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.