restrict EIN to valid prefixes #1909
Open
Conversation
data from the IRS's "How EINs are Assigned and Valid EIN Prefixes" https://www.irs.gov/businesses/small-businesses-self-employed/how-eins-are-assigned-and-valid-ein-prefixes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue#
No-StoryDescription:
This PR changes
Company#einto produce only EINs that start with a prefix that the IRS (the issuing authority) actually uses rather than producing the digits purely at random. The list of valid prefixes comes from the IRS's "How EINs are Assigned and Valid EIN Prefixes". The format of the returned string is unchanged, so this is a non-breaking change.We ran into this in our application where we have stricter validation for the format of EINs (looking at their prefix), and Faker would sometimes produce EINs that ran afoul of that violation.