
Research
/Security News
GlassWASM: WebAssembly Malware Found in Trojanized Open VSX Extensions
The trojanized extensions use TinyGo-compiled WebAssembly and Solana transaction memos to resolve command-and-control infrastructure.
cpf_cnpj
Advanced tools
This gem does some CPF/CNPJ magic. It allows you to create, validate and format CPF/CNPJ, even through the command-line.
Just making my life easier when filling these damn numbers on internet bankings and government sites.
For ActiveModel/ActiveRecord validations, please check https://github.com/fnando/validators.
Add this line to your application's Gemfile:
gem "cpf_cnpj"
And then execute:
$ bundle
Or install it yourself as:
$ gem install cpf_cnpj
This library has the same API for both CNPJ/CPF, so only one of them is documented below.
[!NOTE]
This library already supports the new alphanumeric CNPJ algorithm that will be available starting July 2026. For more information, see https://www.gov.br/receitafederal/pt-br/acesso-a-informacao/acoes-e-programas/programas-e-atividades/cnpj-alfanumerico.
require "cpf_cnpj"
CPF.format(number) # Format CPF (xxx.xxx.xxx-xx)
CPF.valid?(number) # Check if a CPF is valid
CPF.generate # Generate a random CPF number
CPF.generate(true) # Generate a formatted number
cpf = CPF.new(number)
cpf.formatted # Return formatted CPF (xxx.xxx.xxx-xx)
cpf.stripped # Return stripped CPF (xxxxxxxxxxx)
cpf.valid? # Check if CPF is valid
cpf.number_without_verifier # Return CPF without verifier digits
By default, validations will strip any characters that aren't numbers. This
means that 532#####820------857\n96 is considered a valid number. To perform a
strict validation use strict: true.
CPF.valid?(number, strict: true)
If you don't know if the number is a CPF or CNPJ, you can use CpfCnpj to
detect the type of document.
CpfCnpj.which(number)
If the number is valid, it will return a CPF/CNPJ instance. nil will be
returned otherwise.
This library gives you two binaries: cpf and cnpj.
$ cpf --check 532.820.857-96
$ $?
0
$ cpf --check 53282085796
$ $?
0
$ cpf --format 53282085796
532.820.857-96
$ cpf --strip 532.820.857-96
53282085796
$ cpf --generate
417.524.931-17
$ cpf --generate --strip
76001454809
$ echo 76001454809 | cpf -f
760.014.548-09
git checkout -b my-new-feature)git commit -am "Added some feature")git push origin my-new-feature)FAQs
Unknown package
We found that cpf_cnpj demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Research
/Security News
The trojanized extensions use TinyGo-compiled WebAssembly and Solana transaction memos to resolve command-and-control infrastructure.

Security News
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.

Security News
A network of 152 Chrome live wallpaper extensions hid ad tracking and made extension-driven traffic look like Google search clicks.