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
The current phone number system supports E.164 numbers which is great for mass generation of internationally compatible numbers. However, I've run into validation issues with North American numbers given E.164 allows for North American style phone numbers that aren't able to be validated and break the NANP system.
What is NANP?
NANP Is the North American Numbering Plan. A standardized format for the number system in World Zone 1.
NANP numbers?
NANP numbers are ten digits in length
NANP numbers are in the format NXX-NXX-XXXX, where N is any digit 2-9 and X is any digit 0-9.
The first three digits are called the numbering plan area (NPA) code, often called simply the area code.
The second three digits are called the central office code or prefix.
The final four digits are called the line number.
How?
For me and my teams use cases I've put together a small package that allows the generation and validation of NANP format numbers. It's by no means a be-all-end-all and could be further optimized but it's a great start for a discussion to help extend the existing Faker functionality.
Why?
The current phone number system supports E.164 numbers which is great for mass generation of internationally compatible numbers. However, I've run into validation issues with North American numbers given E.164 allows for North American style phone numbers that aren't able to be validated and break the NANP system.
What is NANP?
NANP Is the North American Numbering Plan. A standardized format for the number system in World Zone 1.
NANP numbers?
How?
For me and my teams use cases I've put together a small package that allows the generation and validation of NANP format numbers. It's by no means a be-all-end-all and could be further optimized but it's a great start for a discussion to help extend the existing Faker functionality.
The library can be found here called GoNanp
The text was updated successfully, but these errors were encountered: