Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cpf_cnpj_tools

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cpf_cnpj_tools

  • 0.2.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

CpfCnpjTools

Installation

Install the gem and add to the application's Gemfile by executing:

$ bundle add cpf_cnpj_tools

If bundler is not being used to manage dependencies, install the gem by executing:

$ gem install cpf_cnpj_tools

Usage

For usage, import the gem and create a new instance of it:

require "cpf_cnpj_tools"

generate = CpfCnpjTools::Generator.new

puts generate.generate_cpf(formatted: false) # returns a valid CPF
puts generate.generate_cnpj(formatted: false) # returns a valid cnpj
puts generate.cpf_valid?("999999900") # validate returning true or false
puts generate.cnpj_valid?("99999999000100") # validate returning true or false
puts generate.formatted?("99999999900") # validate if cpf/cnpj is formatted returning true or false
puts generate.format("16255648800") # return the formatted cpf/cnpj. Ex: 162.556.488-00

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ariasdiniz/cpf_cnpj_tools. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the CpfCnpjTools project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

FAQs

Package last updated on 02 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc