The nz_ird function is a specialised utility within the mock-jutsu library, designed to generate realistic New Zealand Inland Revenue Department (IRD) numbers for software development and quality assurance. For developers building financial applications, payroll systems, or tax-related software, having access to accurate mock data is crucial for ensuring that input validation logic functions correctly. This function provides a seamless way to create synthetic identifiers that mimic real-world IRD numbers without compromising the privacy of actual taxpayers or violating data protection regulations.
Every number produced by the nz_ird generator adheres strictly to the official standards set by New Zealand's tax authorities. The function generates strings consisting of eight or nine digits, typically falling within the numerical range of 10,000,000 to 150,000,000. Most importantly, the mock-jutsu engine implements the MOD-11 checksum algorithm, which is the standard validation method used by government systems to verify the mathematical integrity of an IRD number. This high level of precision ensures that the test data will pass through front-end masks and back-end validation routines without being rejected as invalid, allowing for authentic end-to-end testing.
Integrating the nz_ird function into your workflow is straightforward, whether you are working in a local development environment or a complex CI/CD pipeline. Developers can generate values directly from the command line using the "mockjutsu generate nz_ird" command, or programmatically within Python scripts via the "jutsu.generate('nz_ird')" method. For performance testers, the library also supports JMeter integration using the "${__mockjutsu(nz_ird,)}" syntax. This versatility makes it an essential tool for testing accounting software and digital government services where IRD verification is a core requirement.
By utilising mock-jutsu for your test data needs, development teams can significantly reduce the risk of data breaches associated with using production information. The nz_ird function allows for comprehensive edge-case testing, ensuring that your software can handle both eight-digit and nine-digit formats gracefully. Ultimately, this leads to more robust code, faster sprint cycles, and a more reliable user experience for any application operating within the New Zealand financial landscape. This approach ensures that your testing remains compliant, efficient, and technically sound.
mockjutsu generate nz_irdmockjutsu bulk nz_ird --count 10mockjutsu export nz_ird --count 10 --format jsonmockjutsu export nz_ird --count 10 --format csvmockjutsu export nz_ird --count 10 --format sql# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate nz_ird --maskmockjutsu bulk nz_ird --count 5 --maskfrom mockjutsu import jutsujutsu.generate('nz_ird')jutsu.bulk('nz_ird', count=10)jutsu.template(['nz_ird'], count=5)# mask=True: regulation-compliant outputjutsu.generate('nz_ird', mask=True)jutsu.bulk('nz_ird', count=5, mask=True)${__mockjutsu_intl_ids(nz_ird)}# JMeter Function: __mockjutsu_intl_ids# Parameter 1: nz_ird# Parameter 2: (not required for this function)# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_intl_ids(nz_ird,mask)}GET /generate/nz_ird# → {"type":"nz_ird","result":"...","status":"ok"}GET /bulk/nz_ird?count=10POST /template {"types":["nz_ird"],"count":1}# mask=true: regulation-compliant outputGET /generate/nz_ird?mask=trueGET /bulk/nz_ird?count=5&mask=true| Parameter | Values | Description |
|---|---|---|
| --mask | true | false | Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…) |