gerador-validador-cpf

Biblioteca JS open-source para gerar e validar CPF.

MIT License

Downloads
29.5K
Stars
390
Committers
8

Gerador e Validador de CPF Open Source Love

Coverage

Statistics

JS open-source lib to generate and validate CPF.

Tool could be accessed on tiagoporto.github.io/gerador-validador-cpf.

Read in other languages: English, Português(Brasil)

Installation

npm install gerador-validador-cpf --save

Generate CPF

import { generate } from 'gerador-validador-cpf'

generate() // Generates a CPF in the format 00000000000
generate({ format: true }) // Generates a CPF in the format 000.000.000-00

Validate CPF

import { validate } from 'gerador-validador-cpf'

validate('123.456.789-00')
// or
validate('123.456.789-00')

Note: characters like ., - and space are allowed.

Contribute

How to contribute.

Donation

License

Gerador e validador de CPF is released under the terms of the MIT license.