FA-72737 / Check-digit algorithms / Member archive
CPF first check digit can become ten · case 02
Numbers whose first check digit should be 0 are rejected.
Case contract
Brazilian CPF taxpayer number: dots and hyphens removed, then 11 ASCII digits that are not all the same digit (else "malformed"). k1 = (sum of digits 1-9 weighted 10..2) * 10 mod 11 mod 10; k2 = (digits 1-9 and the computed k1 weighted 11..2) * 10 mod 11 mod 10. Return [k1, k2, whether digits 10-11 equal them].
Why this case matters
Onboarding and invoicing flows validate CPF numbers before tax reporting.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression ["123.456.789-00"] | [10, 0, false] | [0, 9, false] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗