Aba.Net
1.0.0
dotnet add package Aba.Net --version 1.0.0
NuGet\Install-Package Aba.Net -Version 1.0.0
<PackageReference Include="Aba.Net" Version="1.0.0" />
<PackageVersion Include="Aba.Net" Version="1.0.0" />
<PackageReference Include="Aba.Net" />
paket add Aba.Net --version 1.0.0
#r "nuget: Aba.Net, 1.0.0"
#:package Aba.Net@1.0.0
#addin nuget:?package=Aba.Net&version=1.0.0
#tool nuget:?package=Aba.Net&version=1.0.0
Aba.Net
Correct, zero-dependency validation of US ABA routing and transit numbers for .NET. Fully offline: the length, the ABA checksum, and the Federal Reserve routing-symbol range, with the district and category reported on success and a typed reason on failure.
MIT Zero dependencies Native AOT clean
Why offline
An ABA routing number is a self-checking 9-digit code. Confirming one is valid needs no network call: the arithmetic is fully specified and runs in microseconds. Yet the only routing-number package on NuGet today reaches out to a remote paid API to do it, which means latency, a per-call bill, an API key to manage, a dependency that can go down, and every account number you validate leaving your process. Aba.Net is the small, correct primitive that does the whole check in memory, so you can validate at the edge of a form without any of that.
Install
dotnet add package Aba.Net
Use
The entry point is the static class RoutingNumber.
using Aba;
bool ok = RoutingNumber.IsValid("021000021"); // true (JPMorgan Chase, NY)
AbaValidationResult result = RoutingNumber.Validate("021000021");
// result.IsValid == true
// result.Category == AbaRoutingCategory.FederalReserve
// result.FederalReserveDistrict == 2
AbaValidationResult bad = RoutingNumber.Validate("021000022");
// bad.IsValid == false
// bad.Reason == AbaFailureReason.BadChecksum
Input is trimmed. Null, empty, whitespace, wrong length, and any non-digit are rejected, each with its own AbaFailureReason (WrongLength, NonDigit, BadChecksum, InvalidRoutingSymbol).
The checksum, explained
Label the nine digits d1 through d9. The ABA check applies the repeating weights 3, 7, 1:
3*(d1 + d4 + d7) + 7*(d2 + d5 + d8) + 1*(d3 + d6 + d9)
The number is valid only when that weighted sum is a nonzero multiple of ten. For 021000021 the sum is 30, so it passes; change the final digit to give 021000022 and the sum becomes 31, so it fails. The all-zero string sums to zero, a multiple of ten, but is rejected because the multiple must be nonzero.
The routing-symbol rule (a limitation, and an option)
The first two digits are the Federal Reserve routing symbol, and only certain ranges are assigned:
| Symbol | Meaning |
|---|---|
| 00 | Some US government and thrift institutions |
| 01 to 12 | The twelve Federal Reserve districts |
| 21 to 32 | Thrift institutions (districts 1 to 12) |
| 61 to 72 | Electronic transactions (districts 1 to 12) |
| 80 | Traveler's checks |
By default (strict: true) a routing symbol outside every one of these ranges is rejected as InvalidRoutingSymbol, and a valid number reports its Category and, where one applies, its FederalReserveDistrict. This is a structural rule, not part of the checksum, so if you only want the length-and-checksum guarantee, pass strict: false:
RoutingNumber.IsValid("990000000"); // false: symbol 99 is unassigned
RoutingNumber.IsValid("990000000", strict: false); // true: length and checksum only
Notes and limitations
- Validation only. This library confirms a routing number is well-formed; it does not tell you which live bank owns it (that requires the Fed's E-Payments directory).
strict: falserelaxes the routing-symbol range check only. The 9-digit length and the checksum are always enforced.- Culture-independent and allocation-light; annotated
IsAotCompatiblefor Native AOT.
License
MIT. Copyright Israel Iyonsi.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 120 | 8/21/2026 |