
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@lacussoft/cpf-gen
Advanced tools
Utility function to generate valid CPF (Brazilian personal ID).
![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
---|---|---|---|---|---|
Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ |
# using NPM
$ npm install --save @lacussoft/cpf-gen
# using Bun
$ bun add @lacussoft/cpf-gen
// ES Modules
import cpfGen from '@lacussoft/cpf-gen'
// Common JS
const cpfGen = require('@lacussoft/cpf-gen')
or import it through your HTML file, using CDN:
<script src="https://cdn.jsdelivr.net/npm/@lacussoft/cpf-gen@latest/dist/cpf-gen.min.js"></script>
let cpf = cpfGen() // returns '47844241055'
cpf = cpfGen({ // returns '005.265.352-88'
format: true
})
cpf = cpfGen({ // returns '52825091138'
prefix: '528250911'
})
cpf = cpfGen({ // returns '528.250.911-38'
prefix: '528250911',
format: true
})
cpfGen({
format: false, // indicates if output should be formatted
prefix: '' // if you have a CPF initials and want to complete it with valid digits.
}) // The string provided must contain between 0 and 9 digits!
We welcome contributions! Please see our Contributing Guidelines for details. But if you find this project helpful, please consider:
This project is licensed under the MIT License - see the LICENSE file for details.
See CHANGELOG for a list of changes and version history.
Made with ❤️ by Lacus Solutions
FAQs
Utility function to generate valid CPF (Brazilian personal ID)
The npm package @lacussoft/cpf-gen receives a total of 607 weekly downloads. As such, @lacussoft/cpf-gen popularity was classified as not popular.
We found that @lacussoft/cpf-gen 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.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.