The mock-jutsu library provides a robust suite of tools for developers requiring high-quality synthetic identifiers, with the dk_cpr function serving as a primary tool for simulating Danish personal data. This function generates a Danish Civil Registration Number, known locally as a CPR number, which is the cornerstone of administrative identity in Denmark. By utilising dk_cpr, engineers can produce realistic test data that mirrors the official ten-digit format, typically represented as DDMMYY-SSSS, ensuring that application interfaces and database schemas remain aligned with regional requirements.
From a technical perspective, the dk_cpr function follows the modern standards established for these identifiers. While historical CPR numbers were required to pass a strict Modulo-11 checksum, the Danish authorities moved away from this requirement in 2007 to ensure a larger pool of available numbers. The mock-jutsu implementation reflects this change, generating a six-digit date of birth followed by a four-digit serial number. This approach allows for the creation of vast datasets without the limitations of legacy validation, making it an essential asset for stress-testing systems that must handle contemporary Danish identity formats.
Integration is a core strength of the mock-jutsu ecosystem, offering multiple ways to access the dk_cpr generator. Developers working within a Python environment can simply call jutsu.generate('dk_cpr') to populate their objects, while those preferring a command-line interface can use the mockjutsu generate dk_cpr command for quick data retrieval. Furthermore, for performance and load testing, the library supports JMeter through the ${__mockjutsu(dk_cpr,)} function. This multi-platform support ensures that whether you are building a unit test or a large-scale simulation, the process of acquiring mock data remains streamlined and efficient.
The practical benefits of using dk_cpr are significant for teams developing healthcare portals, financial services, or government-facing applications. By using realistic test data instead of actual Personally Identifiable Information (PII), organisations can maintain strict GDPR compliance and safeguard data privacy throughout the development lifecycle. Ultimately, mock-jutsu empowers developers to build more resilient software by providing the tools necessary to simulate complex regional identifiers with ease, reducing the manual effort involved in data preparation and accelerating the path to production.
mockjutsu generate dk_cprmockjutsu bulk dk_cpr --count 10mockjutsu export dk_cpr --count 10 --format jsonmockjutsu export dk_cpr --count 10 --format csvmockjutsu export dk_cpr --count 10 --format sql# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate dk_cpr --maskmockjutsu bulk dk_cpr --count 5 --maskfrom mockjutsu import jutsujutsu.generate('dk_cpr')jutsu.bulk('dk_cpr', count=10)jutsu.template(['dk_cpr'], count=5)# mask=True: regulation-compliant outputjutsu.generate('dk_cpr', mask=True)jutsu.bulk('dk_cpr', count=5, mask=True)${__mockjutsu_intl_ids(dk_cpr)}# JMeter Function: __mockjutsu_intl_ids# Parameter 1: dk_cpr# Parameter 2: (not required for this function)# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_intl_ids(dk_cpr,mask)}GET /generate/dk_cpr# → {"type":"dk_cpr","result":"...","status":"ok"}GET /bulk/dk_cpr?count=10POST /template {"types":["dk_cpr"],"count":1}# mask=true: regulation-compliant outputGET /generate/dk_cpr?mask=trueGET /bulk/dk_cpr?count=5&mask=true| Parameter | Values | Description |
|---|---|---|
| --mask | true | false | Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…) |