martinusso / go-docs

CPF / CNPJ validator and generator written in Go.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go-docs

CPF / CNPJ validator and generator written in Go.

Circle CI Build Status Coverage Status GoDoc

Usage

CPF

import "github.com/martinusso/go-docs/cpf"

Valid return a boolean

valid := cpf.Valid("08507460003")

AssertValid return a boolean and the error if any

valid, err := cpf.AssertValid("08507460003")

Generate return a random valid CPF

doc := cpf.Generate()

CNPJ

import "github.com/martinusso/go-docs/cnpj"

Valid return a boolean

valid := cnpj.Valid("34700442000162")

AssertValid return a boolean and the error if any

valid, err := cnpj.AssertValid("34700442000162")

Generate return a random valid CNPJ

doc := cnpj.Generate()

License

This software is open source, licensed under the The MIT License (MIT). See LICENSE for details.

About

CPF / CNPJ validator and generator written in Go.

License:MIT License


Languages

Language:Go 100.0%