public class CpfValidatorKt
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isCpf(java.lang.String $receiver,
java.util.List<java.lang.Character> charactersToIgnore)
Verifies that this String is a CPF
|
public static boolean isCpf(java.lang.String $receiver,
java.util.List<java.lang.Character> charactersToIgnore)
Verifies that this String is a CPF
This function checks if a given string is a CPF (Cadastro de Pessoa Fisica in Portuguese), which is the Brazilian individual taxpayer registry identification.
All strings will first be sanitized, with charactersToIgnore chars removed from it (it's usual for the document to come in the form of xxx.xxx.xxx-yy, which isn't a valid cpf number), and then they'll be validated according to the CPF specification.
The CPFs 111.111.111-11, 222.222.222-22, ..., 999.999.999-99 although numeric valid are considered invalid CPFs as per the specification.
ATTENTION: Although the CPF 000.000.001-91 is supposed to be used only for representing people without a CPF document, it will be considered valid.