The jp_cn function is a specialised utility within the mock-jutsu library designed to generate authentic Japanese Corporate Numbers. Known locally as the Hōjin Bangō, this unique 13-digit identifier is assigned by the National Tax Agency to registered corporations and organisations in Japan. By leveraging this function, developers can produce high-quality mock data that adheres strictly to the official structural requirements, ensuring that automated systems and databases can process the information as if it were a genuine government-issued ID.
Under the hood, the jp_cn generator implements the official MOD-9 check digit algorithm. The first digit of the sequence serves as a check digit, which is mathematically calculated based on the subsequent twelve digits of the corporate ID. This rigorous validation is crucial for test data accuracy, as it allows QA engineers to verify that their input validation logic, checksum routines, and data ingestion pipelines are functioning correctly. Whether you are using the mock-jutsu CLI for quick prototyping or integrating jutsu.generate('jp_cn') directly into a Python-based test suite, the output remains consistently valid and reliable.
Integrating this function into your workflow is seamless across various environments. For performance testing, the JMeter plugin allows for the dynamic injection of corporate identifiers using the ${__mockjutsu(jp_cn,)} syntax, facilitating realistic load tests on financial or enterprise platforms. This versatility is a significant benefit for developers building international ERP systems or B2B marketplaces that require robust validation of Japanese business entities. Using synthetic test data also mitigates the risks associated with handling real sensitive corporate records, aligning with global data protection standards and internal compliance policies.
Ultimately, the jp_cn tool within mock-jutsu streamlines the development lifecycle by removing the friction of manual data creation. By providing a programmatic way to generate valid 13-digit IDs, it empowers teams to focus on core logic rather than data sourcing. Whether you are performing unit tests, integration tests, or complex system simulations, having access to accurate mock data ensures your application is fully prepared for the Japanese market and its specific regulatory requirements.
mockjutsu generate jp_cnmockjutsu bulk jp_cn --count 10mockjutsu export jp_cn --count 10 --format jsonmockjutsu export jp_cn --count 10 --format csvmockjutsu export jp_cn --count 10 --format sql# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate jp_cn --maskmockjutsu bulk jp_cn --count 5 --maskfrom mockjutsu import jutsujutsu.generate('jp_cn')jutsu.bulk('jp_cn', count=10)jutsu.template(['jp_cn'], count=5)# mask=True: regulation-compliant outputjutsu.generate('jp_cn', mask=True)jutsu.bulk('jp_cn', count=5, mask=True)${__mockjutsu_intl_ids(jp_cn)}# JMeter Function: __mockjutsu_intl_ids# Parameter 1: jp_cn# Parameter 2: (not required for this function)# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_intl_ids(jp_cn,mask)}GET /generate/jp_cn# → {"type":"jp_cn","result":"...","status":"ok"}GET /bulk/jp_cn?count=10POST /template {"types":["jp_cn"],"count":1}# mask=true: regulation-compliant outputGET /generate/jp_cn?mask=trueGET /bulk/jp_cn?count=5&mask=true| Parameter | Values | Description |
|---|---|---|
| --mask | true | false | Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…) |