SkillAgentSearch skills...

Brdoc

Brazilian docs validator for Go - CPF, CNPJ, CEP, RENAVAM, CNH and license plate!

Install / Use

/learn @paemuri/Brdoc
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

BR Doc

License go.dev Go Report Card

CPF, CNPJ, CEP, CNH, PIS/PASEP, RENAVAM, CNS, license plate and voter ID 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.

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) (valid bool, uf UF)
  • func IsCEPFrom(doc string, ufs ...UF) 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
  • func IsRG(doc string, uf UF) (valid bool, err error)
  • func IsVoterID(doc string) bool
  • func IsPhone(phone string) (valid bool, uf UF)
  • func IsPhoneFrom(phone string, ufs ...UF) bool

Coisas a fazer

  • [x] validação de CPF
  • [x] validação de CNPJ
  • [x] validação de CEP
  • [x] validação de CNH
  • [x] validação de RENAVAM
  • [x] validação de placa veicular
  • [x] validação de CNS
  • [x] validação de título de eleitor
  • [x] validação de telefone
  • [ ] validação de RG
    • [x] SP
    • [x] RJ
    • [ ] demais estados

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.

View on GitHub
GitHub Stars147
CategoryDevelopment
Updated1mo ago
Forks32

Languages

Go

Security Score

100/100

Audited on Feb 23, 2026

No findings