Deterministic seed 74105923
- Input
- 7,4,1,0,5,9,2,3 → generateRg(source)
- Expected output
- 74.105.923-X
The same digit sequence, replayed from the start, always ends in X because the weighted sum of base 74105923 leaves remainder 1 when divided by 11.
Synthetic Brazilian RG SSP/SP for test fixtures
Every RG fixture needs a plausible value without touching a real identity. This site's RG generator implements the SSP/SP rule: an 8-digit base plus 1 modulo-11 check digit, which can end in X. This page shows how to pin the seed, read the deterministic value and guard the field mask against that trailing X.
The same digit sequence, replayed from the start, always ends in X because the weighted sum of base 74105923 leaves remainder 1 when divided by 11.
This is the fixed value the function returns when all 20 random attempts land on a repeated sequence; useful as a test constant that never changes between runs.
When the remainder of the division by 11 is 0, the computed digit would be 11, and the function substitutes it with 0; the fixture needs to accept an RG of nine consecutive zeros as a valid value.
No. The RG is issued by state agencies and there is no single national algorithm comparable to the CPF's. Each Public Security Secretariat uses its own format and rule, so a number valid in one state may make no sense in another.
Replace the default digit source with a function that always returns the same sequence, or call the function that takes the 8-digit base directly, skipping the random step entirely; either approach guarantees the same RG on every CI run.
Because the last position of an SSP/SP RG can be the letter X, not only a digit; a regex written with digits only, without including X, drops roughly one in every eleven generated values, a classic fixture bug that only shows up intermittently.
Yes, without a deterministic seed the generator does not guarantee uniqueness across calls: it only filters out repeated-digit sequences, not collisions against values already emitted. A suite that needs distinct RGs has to enforce that in the fixture itself, not assume the function handles it.
No, and it should never be treated as one outside an isolated test environment: the calculation only reproduces the SSP/SP format and check digit, without querying any real identity database, live or otherwise.
Generation happens locally in the browser. Analytics receives only action, status, type and format, never the generated RG.