Current section
Files
Jump to
Current section
Files
README.md
# utilsbr
[](https://hex.pm/packages/utilsbr)
[](https://hexdocs.pm/utilsbr/)
[](https://hex.pm/packages/utilsbr)
[](https://hex.pm/packages/utilsbr)

A Gleam library for Brazilian documents utilities. It provides functions to validate and generate CPF and CNPJ documents.
# Installation
Run the following command in your project directory:
```sh
gleam add utilsbr@1
```
# Basic usage
```gleam
import utilsbr/cpf
import utilsbr/cnpj
pub fn main() {
cpf.validate("123.456.789-09")
cpf.strict_validate("123.456.789-09")
cpf.generate(True)
cnpj.validate("12.345.678/0001-09")
cnpj.strict_validate("12.345.678/0001-09")
cnpj.generate(True)
}
```
Further documentation can be found at <https://hexdocs.pm/utilsbr>.