Full 9-digit seed
- Input
- createUsPassportNumber('987654321')
- Expected output
- 987654321
A seed that already has 9 digits passes through unchanged, no padding and no truncation, ready for a test that needs one fixed, predictable value.
U.S. passport number for test fixtures
A boarding form or booking API that expects a 9-digit passport number can be tested without touching a real document: this page shows how the generator produces that synthetic value, what happens with a short seed, and how to reproduce the same number across separate CI runs.
A seed that already has 9 digits passes through unchanged, no padding and no truncation, ready for a test that needs one fixed, predictable value.
A 2-digit seed becomes 9 by padding the remainder with zeros on the right, so the meaningful digits end up at the start of the string, not the end.
This pattern never comes out of `generateUsPassportNumber` because the random draw discards a repeated digit, but `createUsPassportNumber` accepts it since it skips that check, useful for deliberately testing an edge case.
There is no simple public checksum to validate issuance from the number alone.
They get stripped before generating: `createUsPassportNumber` keeps only the digits from the input, so a seed like 'AB123' becomes just '123' and the rest is padded with zeros up to 9 characters.
Yes, pass the literal 9-digit value straight into `createUsPassportNumber`; since there is no random draw on that path, the return value is always the same text you passed in, with no transformation beyond zero-padding a short seed.
Not through the random path: `generateUsPassportNumber` discards a repeated-digit sequence and retries; but you can force that exact value manually with `createUsPassportNumber` to test how the form reacts to that edge case.
Feed a shorter string, say 8 digits, straight into validation (`isValidUsPassportFormat`), which returns false; that confirms the error path without having to build a full-length number just to make it fail on purpose.
Generation happens locally in the browser. Analytics receives only action, status, type and format, never the generated passport number.