CPF, CNPJ, CEP, CNH, RENAVAM, CNS and license plate validator for Go!
Everything in this file, but the License section, is in portuguese.
BR Doc é um pacote para validação, tanto do formato quanto dos dígitos, de documentos brasileiros, como CPF, CNPJ, CEP, CNH, RENAVAM, placa veicular e futuramente RG.
Aceito PRs de todas as formas. Está permitido escrever em português, também. :)
Principais funções:
func IsCPF(doc string) boolfunc IsCNPJ(doc string) boolfunc IsCEP(doc string, ufs ...FederativeUnit) boolfunc IsCNH(doc string) boolfunc IsRENAVAM(doc string) boolfunc IsPlate(doc string) boolfunc IsNationalPlate(doc string) boolfunc IsMercosulPlate(doc string) boolfunc IsCNS(doc string) bool
- validação de CPF
- validação de CNPJ
- validação de CEP
- validação de CNH (obrigado @eminetto!)
- validação de RENAVAM (obrigado @leogregianin!)
- validação de placa veicular
- validação de CNS (obrigado @renatosuero!)
- entender como funciona hífen na CNH (ex.
0067600300-1) - validação de RG
This project code is in the public domain. See the LICENSE file.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be in the public domain, without any additional terms or conditions.