The pt_cc function within the mock-jutsu library is a specialised tool designed for developers and QA engineers who require realistic mock data representing the Portuguese Citizen Card, or Cartão de Cidadão. This function generates unique identifiers that strictly follow the official structure of the Portuguese national identity system. Each generated string typically consists of an eight-digit base number, a control digit, and a three-character versioning suffix, such as "12345678 0 AB4". By utilising pt_cc, technical teams can ensure their applications handle Iberian identity formats accurately without relying on sensitive personal information, making it an essential component for privacy-compliant development and testing environments.
Technically, the pt_cc generator produces strings that mirror the complexity of real-world documentation. The Portuguese Citizen Card format is more than just a random sequence; it incorporates specific algorithms to validate the authenticity of the identification number. This includes the implementation of the Luhn mod 36 algorithm used by the Portuguese government to prevent transcription errors and ensure the integrity of the document number. By integrating this logic, mock-jutsu provides test data that passes through strict validation layers in front-end forms and back-end databases, allowing for comprehensive stress testing of registration, banking, and authentication modules that require valid Portuguese credentials.
Versatility is a core feature of the mock-jutsu ecosystem, and the pt_cc function is accessible across multiple platforms to suit different workflows. For those working in a terminal environment, the CLI command "mockjutsu generate pt_cc" offers immediate results for quick checks. Python developers can seamlessly integrate the tool into their automated scripts using "jutsu.generate('pt_cc')", while performance testers can utilise the JMeter syntax "${__mockjutsu(pt_cc,)}" to populate load tests with valid identity strings. This cross-platform compatibility ensures that high-quality mock data is available at every stage of the software development lifecycle, from initial prototyping to automated regression testing.
Implementing the pt_cc function significantly reduces the manual effort required to create datasets for international applications. Instead of manually crafting strings that may fail validation, developers can generate thousands of unique, compliant entries in seconds. This speed and accuracy are vital for seeding databases, testing edge cases in identity management systems, and ensuring that user interfaces handle the specific spacing and character requirements of the Portuguese ID. Ultimately, mock-jutsu empowers technical teams to build more robust, globally-aware software by providing reliable, high-fidelity test data that simplifies the complexities of international identity standards.
mockjutsu generate pt_ccmockjutsu bulk pt_cc --count 10mockjutsu export pt_cc --count 10 --format jsonmockjutsu export pt_cc --count 10 --format csvmockjutsu export pt_cc --count 10 --format sql# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate pt_cc --maskmockjutsu bulk pt_cc --count 5 --maskfrom mockjutsu import jutsujutsu.generate('pt_cc')jutsu.bulk('pt_cc', count=10)jutsu.template(['pt_cc'], count=5)# mask=True: regulation-compliant outputjutsu.generate('pt_cc', mask=True)jutsu.bulk('pt_cc', count=5, mask=True)${__mockjutsu_intl_ids(pt_cc)}# JMeter Function: __mockjutsu_intl_ids# Parameter 1: pt_cc# Parameter 2: (not required for this function)# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_intl_ids(pt_cc,mask)}GET /generate/pt_cc# → {"type":"pt_cc","result":"...","status":"ok"}GET /bulk/pt_cc?count=10POST /template {"types":["pt_cc"],"count":1}# mask=true: regulation-compliant outputGET /generate/pt_cc?mask=trueGET /bulk/pt_cc?count=5&mask=true| Parameter | Values | Description |
|---|---|---|
| --mask | true | false | Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…) |