The mock-jutsu library provides a robust suite of tools for developers who need to generate realistic synthetic information for global applications. Within its IntlIDs category, the my_nric function stands out as a specialized utility designed to produce Malaysian National Registration Identity Card (NRIC) numbers. This function is essential for software engineers building platforms for the Malaysian market, where the NRIC serves as a primary identifier. By utilizing my_nric, developers can generate high-quality mock data that adheres to the specific 12-digit format of YYMMDD-PB-NNNN, ensuring that testing environments remain populated with data that is both structurally accurate and contextually relevant.
Technically, the my_nric function follows the official standards set by the Malaysian National Registration Department. The first six digits (YYMMDD) represent a valid birth date, while the middle two digits (PB) are generated as valid place-of-birth codes corresponding to specific Malaysian states or territories. The final four digits (NNNN) complete the unique identification sequence. This level of precision is vital when creating test data for systems that perform algorithmic validation, such as verifying the user's age or origin during a registration process. Instead of relying on static or improperly formatted strings, mock-jutsu ensures that every generated value passes basic checksum and formatting logic used by modern web applications.
The developer benefits of using my_nric are significant, particularly concerning data privacy and security. Using real identity numbers in development or staging environments is a major compliance risk that violates PII (Personally Identifiable Information) regulations. By integrating this function into your workflow, you can safely test KYC (Know Your Customer) pipelines, banking portals, and government-linked services without exposing sensitive user data. The function is highly versatile, allowing for seamless integration via the CLI with "mockjutsu generate my_nric," within Python scripts using "jutsu.generate('my_nric')", or even in performance testing scenarios using the JMeter syntax "${__mockjutsu(my_nric,)}".
Ultimately, the my_nric function within mock-jutsu empowers engineering teams to build more resilient applications by providing reliable test data at scale. Whether you are performing manual QA, automated unit testing, or high-volume database seeding, this utility simplifies the complexities of international identity formatting. By automating the creation of valid Malaysian identifiers, developers can focus on refining their application logic and improving user experience while maintaining the highest standards of data integrity and regulatory compliance.
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…) |