The ro_cnp function is a specialized utility within the mock-jutsu library, designed to generate authentic Romanian Personal Numerical Codes, known as the Cod Numeric Personal (CNP). This unique identifier is a cornerstone of Romanian identity documentation, making it an essential piece of test data for developers and QA engineers building applications for the Romanian market. By leveraging mock-jutsu, software teams can instantly produce valid 13-digit strings that adhere to official national standards, ensuring that validation logic in registration forms, financial systems, or database schemas is tested against realistic and structurally sound inputs.
Every identifier generated by the ro_cnp function follows the strict structural requirements mandated by the Romanian government. The 13-digit sequence is not merely random; it encodes critical information, including the individual's gender, century of birth, specific date of birth, and a unique county code. Crucially, the mock-jutsu library implements the MOD-11 checksum algorithm to calculate the final check digit. This level of precision is vital because it allows the mock data to pass through rigorous front-end validation scripts and back-end integrity checks without being flagged as invalid, which is a common hurdle when using manually created or randomly generated strings.
Integration is seamless across various development environments, providing significant flexibility for modern workflows. Developers working in Python can simply call jutsu.generate('ro_cnp') to populate their scripts, while QA engineers can utilize the CLI command "mockjutsu generate ro_cnp" for quick data seeding or shell scripting. For performance testing, the library supports JMeter through the ${__mockjutsu(ro_cnp,)} syntax. This versatility makes mock-jutsu a powerful ally in automated testing pipelines, enabling the rapid creation of thousands of unique records for stress testing or load testing identity management systems without any manual overhead.
Beyond simple validation, the ro_cnp function provides significant benefits for data privacy and regulatory compliance. When developing or demonstrating software, using real personal data is often a violation of GDPR and other privacy regulations. By generating high-quality mock data, teams can simulate complex user scenarios—such as age-restricted access or regional filtering—without risking the exposure of sensitive information. Whether you are building a Fintech platform, a healthcare portal, or a public sector tool, the ro_cnp utility ensures your application handles Romanian identity data with the highest degree of accuracy, reliability, and security.
mockjutsu generate ro_cnpmockjutsu bulk ro_cnp --count 10mockjutsu export ro_cnp --count 10 --format jsonmockjutsu export ro_cnp --count 10 --format csvmockjutsu export ro_cnp --count 10 --format sql# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate ro_cnp --maskmockjutsu bulk ro_cnp --count 5 --maskfrom mockjutsu import jutsujutsu.generate('ro_cnp')jutsu.bulk('ro_cnp', count=10)jutsu.template(['ro_cnp'], count=5)# mask=True: regulation-compliant outputjutsu.generate('ro_cnp', mask=True)jutsu.bulk('ro_cnp', count=5, mask=True)${__mockjutsu_intl_ids(ro_cnp)}# JMeter Function: __mockjutsu_intl_ids# Parameter 1: ro_cnp# Parameter 2: (not required for this function)# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_intl_ids(ro_cnp,mask)}GET /generate/ro_cnp# → {"type":"ro_cnp","result":"...","status":"ok"}GET /bulk/ro_cnp?count=10POST /template {"types":["ro_cnp"],"count":1}# mask=true: regulation-compliant outputGET /generate/ro_cnp?mask=trueGET /bulk/ro_cnp?count=5&mask=true| Parameter | Values | Description |
|---|---|---|
| --mask | true | false | Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…) |