br_cnpjIntlIDs

Mock Jutsu HOW-TO | EN

In the landscape of international business applications, the br_cnpj function within mock-jutsu serves as a critical tool for developers building software tailored for the Brazilian market. A CNPJ, or Cadastro Nacional da Pessoa Jurídica, is the unique identification number assigned to companies and legal entities in Brazil. Generating accurate mock data for this specific identifier is essential for testing registration flows, tax calculation modules, and B2B integrations. By using mock-jutsu, engineers can instantly produce formatted strings like 11.222.333/0001-81, ensuring that their development databases are populated with realistic entries that mirror production environments without compromising sensitive information.

The technical foundation of the br_cnpj generator relies on the MOD-11 algorithm to calculate the two mandatory check digits that conclude the 14-digit sequence. While some basic libraries might provide random numbers, mock-jutsu prioritizes data integrity by strictly adhering to the official Brazilian validation standards. This ensures that every generated value passes through front-end masks and back-end validation logic during the quality assurance phase. This level of precision prevents false negatives in automated testing suites, allowing developers to focus on core feature logic rather than debugging invalid test data that fails checksum requirements.

From a practical standpoint, the br_cnpj function is indispensable for various testing scenarios, such as verifying the behavior of financial systems or validating supplier onboarding forms. Whether you are running a quick check via the CLI with the command "mockjutsu generate br_cnpj" or embedding the logic directly into a Python script using "jutsu.generate('br_cnpj')", the library provides a seamless and consistent experience. Furthermore, performance testers can leverage the JMeter integration via the mock-jutsu function call to simulate high-concurrency registration events without the need for manual data entry or external CSV files.

Ultimately, the primary benefit of using mock-jutsu for generating Brazilian corporate IDs is the significant reduction in development overhead. Instead of manually creating spreadsheets of valid numbers or writing custom scripts to handle complex MOD-11 logic, teams can rely on a standardized, professional tool. This streamlining of the development lifecycle ensures that applications are robust, compliant with regional requirements, and ready for deployment in complex international markets. By integrating this function into your CI/CD pipeline, you ensure that your test data remains consistent, reliable, and perfectly formatted for every build.

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

Parameters

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

Other Languages