Skip to content

This is validator, generator and formats the brazil code as CPF and CNPJ

License

Notifications You must be signed in to change notification settings

potatowski/brazilcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Brazil-Code

This is validator, generator and formats the brazil code as CPF and CNPJ

Formats to use

  • CPF
  • CNPJ
  • CNH
  • VoterRegistration(Título de Eleitor)

Development

Import package with command in shell

$ go get github.com/potatowski/brazilcode

In code just use the function with import

Example:

package main

import (
	"fmt"

	"github.com/potatowski/brazilcode"
)

func main() {
	doc, err := brazilcode.CNPJGenerate()
	if err != nil {
		panic(err)
	}

	docFormatted, err := brazilcode.CNPJFormat(doc)
	if err != nil {
		panic(err)
	}

	fmt.Println(doc, docFormatted)
}

License

The MIT License © 2023 João Vitor Lima da Rocha

About

This is validator, generator and formats the brazil code as CPF and CNPJ

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages