br_cpfIntlIDs

Mock Jutsu HOW-TO | EN

In the realm of international software development, generating valid regional identifiers is a critical step for robust quality assurance and system validation. The br_cpf function within the mock-jutsu library is specifically designed to provide developers with realistic Brazilian Cadastro de Pessoas Físicas (CPF) numbers. As a cornerstone of the IntlIDs category, this tool ensures that your test data remains compliant with Brazilian standards without requiring access to sensitive, real-world personal information. By using mock-jutsu to automate this process, engineering teams can significantly accelerate their development cycles while maintaining high data integrity across various testing environments.

The technical implementation of the br_cpf function adheres strictly to official Brazilian regulatory standards to ensure maximum compatibility. Each generated string consists of eleven digits, typically presented in the standard format of nine base numbers followed by two crucial check digits. To ensure authenticity, mock-jutsu employs the MOD-11 algorithm to calculate these suffixes, making the resulting mock data indistinguishable from genuine identifiers to most validation engines. This level of precision is essential for testing front-end input masks, back-end validation logic, and database constraints that require mathematically sound ID sequences to function correctly during comprehensive integration tests.

Versatility is a primary advantage when incorporating the br_cpf function into a modern dev-ops workflow. Developers can generate test data through multiple interfaces depending on their specific needs. For instance, those working directly in a Python environment can invoke jutsu.generate('br_cpf'), while those preferring a command-line approach for rapid prototyping can use mockjutsu generate br_cpf. Furthermore, for teams conducting performance or load testing, the JMeter integration allows for the seamless injection of unique identifiers using the ${__mockjutsu(br_cpf,)} syntax. This flexibility ensures that whether you are building a fintech application, a government portal, or a simple registration form, your testing suite remains consistent and efficient.

Beyond simple generation, the br_cpf utility provides a secure way to simulate complex user scenarios without the legal risks associated with handling real PII (Personally Identifiable Information). It allows QA engineers to populate sandbox environments with high-volume, realistic datasets that mirror the diversity of a real Brazilian user base. By integrating this function into your CI/CD pipelines, you ensure that every build is vetted against rigorous data standards. Ultimately, mock-jutsu empowers developers to focus on building features rather than manually crafting complex identifiers, streamlining the path from development to production with reliable, high-quality mock data.

CLI Usage
mockjutsu generate br_cpfmockjutsu bulk br_cpf --count 10mockjutsu export br_cpf --count 10 --format jsonmockjutsu export br_cpf --count 10 --format csvmockjutsu export br_cpf --count 10 --format sql# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate br_cpf --maskmockjutsu bulk br_cpf --count 5 --mask
Python API
from mockjutsu import jutsujutsu.generate('br_cpf')jutsu.bulk('br_cpf', count=10)jutsu.template(['br_cpf'], count=5)# mask=True: regulation-compliant outputjutsu.generate('br_cpf', mask=True)jutsu.bulk('br_cpf', count=5, mask=True)
JMeter
${__mockjutsu_intl_ids(br_cpf)}# JMeter Function: __mockjutsu_intl_ids# Parameter 1: br_cpf# Parameter 2: (not required for this function)# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_intl_ids(br_cpf,mask)}
REST API
GET /generate/br_cpf# → {"type":"br_cpf","result":"...","status":"ok"}GET /bulk/br_cpf?count=10POST /template {"types":["br_cpf"],"count":1}# mask=true: regulation-compliant outputGET /generate/br_cpf?mask=trueGET /bulk/br_cpf?count=5&mask=true

Parameters

Parameter Values Description
--mask true | false Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…)

Other Languages