brdoc
brdoc copied to clipboard
Brazilian docs validator for Go - CPF, CNPJ, CEP, RENAVAM, CNH and license plate!
BR Doc
CPF, CNPJ, CEP, CNH, PIS/PASEP, RENAVAM, CNS and license plate validator for Go!
Everything in this file, but the License section, is in portuguese.
Descrição
BR Doc é um pacote para validação, tanto do formato quanto dos dígitos, de documentos brasileiros, como CPF, CNPJ, CEP, CNH, PIS/PASEP, RENAVAM, placa veicular e futuramente RG.
Aceito PRs de todas as formas. Está permitido escrever em português, também. :)
Uso
Principais funções:
func IsCPF(doc string) boolfunc IsCNPJ(doc string) boolfunc IsCEP(doc string, ufs ...FederativeUnit) boolfunc IsCNH(doc string) boolfunc IsPIS(doc string) boolfunc IsRENAVAM(doc string) boolfunc IsPlate(doc string) boolfunc IsNationalPlate(doc string) boolfunc IsMercosulPlate(doc string) boolfunc IsCNS(doc string) bool
Coisas a fazer
- [x] validação de CPF
- [x] validação de CNPJ
- [x] validação de CEP
- [x] validação de CNH (obrigado @eminetto!)
- [x] validação de RENAVAM (obrigado @leogregianin!)
- [x] validação de placa veicular
- [x] validação de CNS (obrigado @renatosuero!)
- [ ] validação de RG
License
This project code is in the public domain. See the LICENSE file.
Contribution
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.