- #138 Implement
IParsable<TSelf>
on Iban type.
- Upgraded SWIFT registry provider to July '23 release 95, which adds Falkland Islands (FK).
- Upgraded Wikipedia registry provider, which adds North Macedonia (MK).
- #144 Add Catalan localization.
- In
IbanParser
internals, useReadOnlySpan<T>
. - Add additional constructor overloads to
IbanValidator
, in preparation of possible deprecation ofIbanValidatorOptions
. Even if not deprecating, it is still convenient.
-
Upgraded SWIFT registry to April '23 release 94, which adds Mongolia (MN) and Nicaragua (NI).
- Importantly, the spec for Nicaragua seems to differ from what is listed on Wikipedia (28 vs 32 char length). The website of the Central Bank of Nicaragua confirms this.
- Additionally the included example for Nicaragua does NOT validate and I had to resort to patching the example data.
- the last updated timestamp of Georgia (GE) was also changed, because of an update to contact information in the spec (unused by IbanNet).
As with any new addition to the registry, some caution is advised and possibly changes are to be expected as I've seen such inaccuracies more often in the past.
-
Refactored pattern tokenizer to support wide tokens (multi char), next to (single) char tokens. This is an internal change that can unlock some extra future functionality.
-
Fix: the property
IbanRegistry.Providers
is made read-only after hydrating/using the registry to prevent it from being modified.
- Upgraded SWIFT registry to Feb '23 release 93, which adds Somalia (SO) and fixes some misconfiguration for Finland (FI) removing the need for 'some' patching (no regression).
- Updated Wikipedia provider, which updates validation patterns for Dominican Republic (DO), Georgia (GE), Ireland (IE), Jordan (JO), Pakistan (PK), Palestinian territories (PS), Turkey (TR), British Virgin Islands (VG) and Burundi (BI).
- Update
FluentValidation
to v11.3.0 - Updated Wikipedia registry provider which corrects the IBAN and BBAN pattern for Azerbaijan (AZ). The Swift registry (which is the default) was already correct, so there is no regression if you do not use the Wikipedia provider.
- #116 Added .NET 7 target framework support
- Performance improvements (10-20%):
- Use
CollectionsMarshal.AsSpan
in some areas to improve enumeration perf - Use faster API's to change a
Span<char>
back to astring
- Use new .NET 7
char
API's and aggressive inline ownchar
extensions - Rework
Pattern
lazy init to improve init time - When parsing, do not allocate and return a new copy of the input if no normalization was performed.
- Use
- Lazy initialization of
IbanRegistry
is now thread safe. - Add ctor overload to
IbanGenerator
which enables specifying a seed for consistent, reproduceable generation. - Enable deterministic build/assemblies
- #97 Add Dutch localized exception/result messages.
- Move normalization to
IbanParser
fromIbanValidator
. This means that the validator is now validating 100% strict according to character pattern rules (character class, case and whitespace, etc.).ValidationResult.AttemptedValue
will now also have the raw input. Whitespace/casing is still ignored by theIbanParser
. - Add Strict-property (default true) to
IbanAttribute
andFluentIbanValidator
extension. When Strict=true, the input must strictly match the IBAN format rules. When Strict=false, whitespace is ignored and strict character casing enforcement is disabled (meaning, the user can input in lower and uppercase). This mode is a bit more forgiving when dealing with user-input. However it does require after successful validation, that you parse the user input withIbanParser
to normalize/sanitize the input and to be able to format the IBAN in correct electronic format. - When normalizing, carriage return (CR) and line feed (LF) are no longer stripped.
IllegalCharactersResult
andInvalidStructureResult
have a propertyPosition
which indicates the 0-based position at which the first invalid character was encountered.- ~15-20% Performance improvements to pattern validator.
- Fix registration bug where if custom registry was registered, it would still additionally register IbanNet instead of ignoring.
- Regenerated Wikipedia registry which corrects IBAN pattern for Senegal (SN).
- Add code gen SWIFT CSV record patchers (so that this no longer requires manual work on each registry update)
- #78 Adds branch information to FR
- LTS: dropped support for .NET 5.0
- Updated System.ComponentModel.Annotations to v5.0.0
- Updated Autofac to 6.4.0
- Updated FluentValidation to 11.1.0
- Upgraded SWIFT registry to May '22 release 92, which adds Djibouti (DJ), fixes the bank pattern for Bahrain (BH).
- Upgraded Wikipedia registry which corrects English name for Sao Tome (ST).
- Fixed SWIFT country definitions for which the 'included country codes' contained inferred locales. The list now actually contains the expected country codes.
- LTS: dropped support for .NET 4.5.2 and .NET Standard 1.2/1.3. Added .NET 4.6.2.
- Use new
Chunk()
LINQ API for .NET 6 and change ownPartition()
method into polyfill for older framework targets. - Added
AcceptCountryRule
to restrict validation to a specific set of countries. The rule can be added via the validator options or dependency registration extensions.
- Change
master
branch tomain
, requiring update to CI scripts, and update all external page references.
- Add package README's
- Added .NET 6 target
- Added
IbanCountry.NativeName
property which returns the country name in native language, if available. - Changed the
IbanCountry.DisplayName
property to return the native name, if available; otherwise returns the English name. - Regenerated
WikipediaRegistryProvider
to include Sudan (SD). - Implemented
IEquatable<T>
. - Implemented
IFormattable
with format stringsE
,P
andO
forElectronic
,Print
andObfuscated
respectively. - Upgraded registry to October '21 release 91 (added Burundi (BI) and updated Sudan (SD))
- Added JSON converter support for
System.Text.Json
to theIban
type (>= .NET 5 only) - Added
iban.IsQrIban()
extension method. A Swiss or Liechtenstein QR-IBAN must have a valid QR-IID, i.e. the bank number must be within the [30000, 31999] range.
- Removed deprecated contracts/code
IStructureValidationFactory
,IStructureValidation
,IStructureSection
. Use thePattern
abstraction for custom registry providers. - Removed
Iban.Parse
,Iban.TryParse
, use theIbanParser
class. - Added support for more countries based on Wikipedia.
- Removed
ValidationMethod
, since performance in strict (= default) is now significantly faster (compared to v4.x, even in loose mode). The maintenance is not worth the little gains anymore. - Cleaned up API surface/sealed several types.
- Added
Country
,Bban
,BankIdentifier
andBranchIdentifier
properties to theIban
value type. - Removed obsolete facade for
SwiftRegistryProvider
. - Upgraded registry to June '21 release 90 (added Sudan (SD))
- Updated to FluentValidation v10.x, dropping .NET 4.6.1.
IIbanParser
andIIbanGenerator
are now registered as singletons.- Added
IIbanRegistry
as resolveable service (singleton).
- Moved
SwiftRegistryProvider
to new namespace, kept facade for backwards compatibility. The facade will be removed in v5.0.
- Deprecate loose validation mode. Will be removed in v5.0.
IIbanRegistry.TryGetValue
now supports case insensitive country codes.
- #21 #31 Added
IbanGenerator
. - LTS: change target frameworks .NET 4.5 and 4.7 to 4.5.2 and 4.7.2 respectively.
- Fix Iraq (IQ) and Finland (FI) patterns (does not affect validation outcome).
- Introduce pattern abstraction for registry which encapsulates a pattern string and tokenizer. Deprecates
IStructureValidationFactory
, but keeps backwards compatible. Patterns are useful when implementing more/future providers to extend country support.
- Upgraded registry to March '21 release 89 (updated Andorra (AD) and El Salvador (SV))
- Added .NET 5.0 target framework support (benchmark).
- Update several nullable reference type code contracts.
- Updated to FluentValidation v9.x. This also means dropping support for .NETStandard 1.1/1.6 for FluentValidation integration.
- (breaking) Updated to Autofac v6.x (one Autofac interface changed)
- Upgraded registry to September '20 release 88 (added Libya (LY))
- Added
IbanBuilder
andBbanBuilder
types.
- IBAN's are now always converted to upper case prior to validation.
- Replaced
Iban.ToString(string)
withIban.ToString(IbanFormat)
, and added obfuscated format.
- #19 Parse should only allow non-nullable string.
- #23 AttemptedValue did not match actual value used in validation.
- #24 Structure test will ignore country code casing.
- Upgraded registry to May '20 release 87 (changes to ST)
- Added
IbanParser
which provides equivalent non-static functionality toIban.Parse
andIban.TryParse
(which will be obsolete). - Added .NET Standard 2.1 target
- Enabled and refactored for non-nullable reference types.
- Added abstraction to load registry from different sources.
- Added
ICheckDigitsCalculator
abstraction. - Exposing
IIbanValidationRule
allowing custom validation rules. - Performance improvements
- (breaking)
Iban.Parse
andIban.TryParse
are obsolete, useIIbanParser
. - (breaking) Added IbanValidator ctor overload accepting an
IbanValidatorOptions
class, providing options with validation method (strict = default vs loose), extensibility through custom rules. - (breaking) Refactored out enum
IbanValidationResult
, replaced with result object pattern for extensibility. - (breaking)
ValidationResult
now containsError
-property containing the error that occurred. - (breaking) Remove deprecated TypeConverter facade.
- (breaking) Remove deprecated ctor (accepting
Lazy
). - (breaking)
IbanValidator.SupportedCountries
now is a dictionary, allowing look up by country code. - (breaking) Renamed
CountryInfo
toIbanCountry
. - (breaking) Renamed
ValidationResult.Value
toValidationResult.AttemptedValue
. - (breaking) Moved
Branch
andBank
properties fromBbanStructure
toIbanCountry
and all offsets are now relative to entire IBAN. This makes it easier to extract this data from an IBAN. - (breaking)
IbanAttribute
no longer uses staticIban.Validator
as fallback since it is unclear it does so. TheIIbanValidator
will now only be resolved from IoC container and as such if not registered an exception is thrown.
- backport: Upgraded registry to May '20 release 87 (changes to ST)
- Upgraded registry to Januari '20 release 85 (improves Egypt, not effective until 2021).
- Upgraded registry to October '19 release 84 (adds Egypt).
- Enabled SourceLink.
- Removed ability to apply
IbanAttribute
to fields, since model validation does not occur for fields. - Improved continuous integration, added code coverage.
- Deprecated
IbanNet.IbanTypeConverter
, replaced byIbanNet.TypeConverters.IbanTypeConverter
. - Added IbanNet.FluentValidation package.
- Upgraded registry to April '19 release 83.
- Added extra target frameworks
.NET 4.7
,.NET Standard 1.6
and.NET Standard 2.0
- Partial rewrite to support the official Swift IBAN registry.
- Added support for 4 more countries for a total of 76.
- Added details through
CountryInfo
, including IBAN, BBAN, bank and branch structure information, whether a country is a SEPA member and more. - (breaking) Replaced
IbanValidator.SupportedRegions
withIbanValidator.SupportedCountries
. - (breaking) The
IIbanValidator.Validate
method now returns aValidationResult
object, instead of an enum value, in order to provide more information of the validation.
- Added IbanNet.DataAnnotations for DataAnnotation support.
- (breaking) retarget from .NET Framework 4.5.2 to .NET 4.5.
- Added
TypeConverter
support.
- Expose supported regions via
IbanValidator.SupportedRegions
- Convert to .NET Standard 1.2
- Initial release with support for 72 countries