The my_nric function within the mock-jutsu library provides developers with a reliable method for generating realistic Malaysian National Registration Identity Card numbers. As a core component of the IntlIDs category, this tool is indispensable for software testing where regional identity verification is a primary requirement. By producing synthetic but structurally accurate mock data, mock-jutsu ensures that systems can be evaluated thoroughly without risking the exposure of sensitive personal information or violating stringent data privacy regulations.
Structurally, the my_nric function adheres strictly to the official Malaysian standard: a twelve-digit string represented in the YYMMDD-PB-NNNN format. The first six digits represent the individual's birth date, while the subsequent two digits (PB) denote a valid birth place code as defined by the National Registration Department of Malaysia. This level of precision is crucial for generating test data that must satisfy complex validation logic, such as checks for legitimate state codes or chronological consistency. Whether you are using the CLI via "mockjutsu generate my_nric", the Pythonic "jutsu.generate('my_nric')", or the JMeter function "${__mockjutsu(my_nric,)}", the output remains consistent and syntactically correct.
For developers building financial services, government portals, or e-commerce platforms, having access to high-quality mock data is a significant advantage. The my_nric function allows for comprehensive testing of registration workflows, Know Your Customer (KYC) processes, and age-restricted access controls. Because the generated strings mimic real-world identifiers—such as the example 701231-08-5678—automated test suites can verify database constraints and front-end input masks with high fidelity. This reduces the friction typically associated with manual data entry during the quality assurance phase.
Beyond basic functionality, using mock-jutsu to generate test data fosters a more robust and compliant development lifecycle. It eliminates the need to scrape or reuse real user data, thereby aligning development practices with global standards like GDPR or Malaysia’s PDPA. By integrating my_nric into continuous integration pipelines, teams can automate the population of staging environments with diverse datasets. This ensures that edge cases involving specific birth years or regional codes are accounted for, leading to more resilient and secure applications.
mockjutsu generate my_nricmockjutsu bulk my_nric --count 10mockjutsu export my_nric --count 10 --format jsonmockjutsu export my_nric --count 10 --format csvmockjutsu export my_nric --count 10 --format sql# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate my_nric --maskmockjutsu bulk my_nric --count 5 --maskfrom mockjutsu import jutsujutsu.generate('my_nric')jutsu.bulk('my_nric', count=10)jutsu.template(['my_nric'], count=5)# mask=True: regulation-compliant outputjutsu.generate('my_nric', mask=True)jutsu.bulk('my_nric', count=5, mask=True)${__mockjutsu_intl_ids(my_nric)}# JMeter Function: __mockjutsu_intl_ids# Parameter 1: my_nric# Parameter 2: (not required for this function)# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_intl_ids(my_nric,mask)}GET /generate/my_nric# → {"type":"my_nric","result":"...","status":"ok"}GET /bulk/my_nric?count=10POST /template {"types":["my_nric"],"count":1}# mask=true: regulation-compliant outputGET /generate/my_nric?mask=trueGET /bulk/my_nric?count=5&mask=true| Parameter | Values | Description |
|---|---|---|
| --mask | true | false | Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…) |