Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
cpf
Functions to handle brazilian CPF numbers
You can install it with npm or yarn.
Try:
npm install cpf
yarn add cpf
const CPF = require('cpf');
Now, CPF
is a object with some functions:
format
generate
isValid
CPF.format(cpf)
Format a CPF number.
CPF.format('11144477735');
//=> '111.444.777-35'
cpf
{string} A CPF number.Returns a string with the formatted CPF number.
CPF.generate(formatted, invalid)
Generate a random CPF number.
formatted
{boolean} true
by default. It will generate a formatted CPF number.invalid
{boolean} false
by default. It will generate a invalid CPF number.Returns a CPF number.
CPF.isValid(cpf, byLength)
Check if a CPF number is valid.
CPF.isValid('111.444.777-35');
// true
CPF.isValid('111.444.777-42');
// false
CPF.isValid('111.444.777-42', true);
// true
CPF.isValid('111.444.777', true);
// false
cpf
{string} Check if the CPF number is valid.byLength
{boolean} false
by default. Check only if the length is valid.Returns the check result.
MIT © Matheus Alves
FAQs
Functions to handle brazilian CPF numbers.
The npm package cpf receives a total of 6,684 weekly downloads. As such, cpf popularity was classified as popular.
We found that cpf demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.