I hereby claim:
- I am gplgps on github.
- I am gplgps (https://keybase.io/gplgps) on keybase.
- I have a public key ASC91-NFScJs9Nqlet3DVT8QwdG3TdHYRjWBKA0ZYIpGNQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
public static boolean validateNumeroDocumentoCC(String numeroDocumento){ | |
// C# Source: https://www.autenticacao.gov.pt/documents/20126/115760/Valida%C3%A7%C3%A3o+de+N%C3%BAmero+de+Documento+do+Cart%C3%A3o+de+Cidad%C3%A3o.pdf | |
int sum = 0; | |
boolean secondDigit = false; | |
if (numeroDocumento == null) | |
throw new IllegalArgumentException("Número de documento não pode ser null."); | |
if(numeroDocumento.length() != 12) | |
throw new IllegalArgumentException("Tamanho inválido para número de documento."); | |
for (int i = numeroDocumento.length()-1; i >= 0; --i){ | |
int valor = getNumberFromChar(numeroDocumento.charAt(i)); |