Pair of classes to validate Brazil's CPF and CNPJ
Add this to your application's shard.yml
:
dependencies:
cpf_cnpj:
github: CubosTecnologia/cpf_cnpj-crystal
require "cpf_cnpj"
cpf = CPF.new("182.77702876")
cpf.valid? # true
cpf.to_s # "182.777.028-76"
cnpj = CNPJ.new("66.028.218/0001-62")
cnpj.valid? # true
cnpj.to_s # "66.028.218/0001-62"
- Fork it ( https://github.com/CubosTecnologia/cpf_cnpj-crystal/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
- lbguliherme - creator, maintainer