goric

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2020 License: MIT Imports: 3 Imported by: 0

README

goric

Documentation Coverage Status Go Report Card CircleCI

A Library in Go for validation of Brazilian documents.

Installation
go get github.com/digenaldo/goric
Import
import (
	"github.com/digenaldo/goric"
)
Usage
package main

import (
	"github.com/digenaldo/goric"
)

func main() {
	//returns if cpf is valid
	b, err := goric.CpfIsValid("89576827086")

	//returns if cpf size is valid
	b1 := goric.CpfSizeIsValid("89576827086")

	//verifies that the CPF digits are valid
	b2 := goric.CpfDigitsValid("89576827086")
}
To do list
  • CPF
  • CNH
  • Título de Eleitor
  • PIS
References
API Methods

To see the full list of API methods check out the documentation on godoc.org

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CpfDigitsValid

func CpfDigitsValid(d string) bool

CpfDigitsValid check if the cpf digits are valid

func CpfIsValid

func CpfIsValid(d string) (bool, error)

CpfIsValid validates the cpf standard for Brazilian documents

func CpfSizeIsValid

func CpfSizeIsValid(d string) bool

CpfSizeIsValid verifies that the cpf size is 11

func GenerateCpfFirstDigit

func GenerateCpfFirstDigit(d string) int

GenerateCpfFirstDigit generate first cpf digit

func GenerateCpfSecondDigit

func GenerateCpfSecondDigit(d string) int

GenerateCpfSecondDigit generate second cpf digit

func InvalidCpfIsKnown

func InvalidCpfIsKnown(d string) bool

InvalidCpfIsKnown verifies that the cpf is in the known invalid format

func RemoveEspecChar

func RemoveEspecChar(d string) string

RemoveEspecChar remove special characters

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL