cpf_cnpj

Version, currently master branch1 version
  • master branchlatestJun 22, 2016

github.com/cubos/cpf_cnpj-crystal

Pair of classes to validate CPF and CNPJ

1 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  cpf_cnpj:
    github: cubos/cpf_cnpj-crystal
    branch: master

master is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
no constraint declared
License
MIT
Author
unnamed author

Dependencies

This version declares no dependencies.

README

Build Status

cpf_cnpj

Pair of classes to validate Brazil's CPF and CNPJ

Installation

Add this to your application's shard.yml:

dependencies:
  cpf_cnpj:
    github: CubosTecnologia/cpf_cnpj-crystal

Usage

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"

Contributing

  1. Fork it ( https://github.com/CubosTecnologia/cpf_cnpj-crystal/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors