The CPF is formed by 11 digits, and the verification of the CPF is carried out from the first 9 digits
Example CPF 111.333.666-XX
To calculate take the 9 first digit we will use the formula below:
T = d0x10 + d1x9 + d2x8 + d3x7 + d4x6 + d5x5 + d6x4 + d7x3 + d8x2Result:
T = 1x10 + 1x9 + 1x8 + 3x7 + 3x6 + 3x5 + 6x4 + 6x3 + 6x2Since Y is greater than or equal to 2 we will apply rule 2
First Check Digit = 11 - 3To calculate take the 9 first digit plus the first check digit we will use the formula below:
T = d0x11 + d1x10 + d2x9 + d3x8 + d4x7 + d5x6 + d6x5 + d7x4 + d8x3 + d9x2Result:
T = 1x11 + 1x10 + 1x9 + 3x8 + 3x7 + 3x6 + 6x5 + 6x4 + 6x3 + 8x2Since Y is greater than or equal to 2 we will apply rule 2
Second Check Digit = 11 - 5Final result is 111.333.666-86