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) bool
-
func IsCNPJ(doc string) bool
-
func IsCEP(doc string, ufs ...FederativeUnit) bool
-
func IsCNH(doc string) bool
-
func IsPIS(doc string) bool
-
func IsRENAVAM(doc string) bool
-
func IsPlate(doc string) bool
-
func IsNationalPlate(doc string) bool
-
func IsMercosulPlate(doc string) bool
-
func 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.