You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
XXXXYYYYC
where XXXX is Federal Reserve Routing Symbol, YYYY is ABA Institution Identifier, and C is the check digit.
...
The first two digits of the nine digit RTN must be in the ranges 00 through 12, 21 through 32, 61 through 72, or 80.
- 00 is used by the [United States Government](https://en.wikipedia.org/wiki/Federal_government_of_the_United_States)
- 01 through 12 are the "normal" routing numbers, and correspond to the 12 [Federal Reserve Banks](https://en.wikipedia.org/wiki/Federal_Reserve_Bank). For example, 0260-0959-3 is the routing number for Bank of America incoming wires in New York, with the initial "02" indicating the [Federal Reserve Bank of New York](https://en.wikipedia.org/wiki/Federal_Reserve_Bank_of_New_York).
- 21 through 32 were assigned only to [thrift institutions](https://en.wikipedia.org/wiki/Cooperative_banking) (e.g. [credit unions](https://en.wikipedia.org/wiki/Credit_union) and savings banks) through 1985, but are no longer assigned (thrifts are assigned normal 01–12 numbers). Currently they are still used by the thrift institutions, or their successors, and correspond to the normal routing number, plus 20. (For example, 2260-7352-3 is the routing number for Grand Adirondack Federal Credit Union in New York, with the initial "22" corresponding to "02" (New York Fed) plus "20" (thrift).)
- 61 through 72 are special purpose routing numbers designated for use by non-bank payment processors and clearinghouses and are termed Electronic Transaction Identifiers (ETIs), and correspond to the normal routing number, plus 60.
- 80 is used for [traveler's checks](https://en.wikipedia.org/wiki/Traveler%27s_check)
...
Check digit
The ninth, check digit provides a checksum test using a position-weighted sum of each of the digits. High-speed check-sorting equipment will typically verify the checksum and if it fails, route the item to a reject pocket for manual examination, repair, and re-sorting. Mis-routings to an incorrect bank are thus greatly reduced.
The following condition must hold:
(3*(d1 + d4 + d7) + 7*(d2 + d5 + d8) + 1*(d3 + d6 + d9)) mod 10 = 0
Can you please provide more info about rules of generation for US routing number (ABA RTN) in Finance with some ref to official source of truth
I added description with links.
The motivation of adding this logic to datafaker is to be able to generate ABA RTN with correct check digit, otherwise we could just run faker.numerify("#".repeat(9))
@polarfish That is up to you; if you want it in the 1.x version, then we would welcome a PR, otherwise it will most likely only end up in the 2.x release.
polarfish
added a commit
to polarfish/datafaker
that referenced
this pull request
May 7, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ABA RTN Format
References