US Phone Nu
Purpose
This component masks U.S. phone numbers by replacing only the numeric digits with randomly generated numbers, while preserving the original format, country code, area code, and separators. It supports commonly used formats such as:
- 123-456-7890 → 123-203-5691
- 123.456.7890 → 123.931.4826
- (123) 456-7890 → (123) 341-7250
- 123 456 7890 → 123 875 1268
- +1(123) 456-7890 → +1(123) 422-1178
All non-numeric separators (such as dashes, spaces, dots, and parentheses) are retained exactly as they appear in the original value. The component substitutes only numeric digits and does not allow alphabetic characters.
The component checks that the phone number contains exactly 10 numeric digits (xxx xxx xxxx) or country code + 10 numeric digits (+1 xxx xxx xxxx). Numbers with more or fewer digits result in an error.
Each masking operation is fully random, so the same original phone number may produce different results in different runs. This version is intended for use cases where referential integrity is not required.
Algorithm
Variation of Random Character Permutation Algorithm
Data Masking Components: US Phone Nu