mrz_td3MRZ

Mock Jutsu HOW-TO | UK

In the realm of identity verification and travel document processing, the mrz_td3 function within the mock-jutsu library stands as a vital tool for developers and QA engineers. This specific function generates synthetic Machine Readable Zone (MRZ) data adhering strictly to the ICAO 9303 Part 3 standard for TD3-size documents, which is the international standard for passport bio-pages. By producing a standardised two-line string of 44 characters per line, it provides realistic test data that mirrors the exact structure found on physical documents, including document types, issuing country codes, and holder names.

Technical accuracy is paramount when dealing with sensitive document formats, and mrz_td3 ensures that every generated string is computationally sound. The function meticulously calculates composite check digits and validates date formats for both the date of birth and the expiry date using the YYMMDD format. It also accommodates optional fields such as personal numbers, ensuring that the mock data passes through rigorous validation algorithms just like a genuine document. This level of precision makes it an indispensable asset for software engineers building Optical Character Recognition (OCR) engines or border control management systems that require high-fidelity inputs.

Integrating this function into your development lifecycle is remarkably straightforward, regardless of your preferred environment. Whether you are using the mock-jutsu Python API for unit testing, the command-line interface for rapid prototyping, or the JMeter plugin for load testing, the mrz_td3 utility delivers consistent and reliable results. This versatility allows teams to simulate thousands of unique passport entries without relying on real-world sensitive information, thereby maintaining strict privacy compliance while ensuring robust system performance across various platforms.

Beyond basic data generation, the mrz_td3 tool is perfect for edge-case testing, such as handling long surnames, varying nationalities, or near-expiry dates. By leveraging this feature of mock-jutsu, quality assurance teams can verify that their applications correctly parse complex MRZ strings and handle checksum failures gracefully. Ultimately, using high-quality test data accelerates the development cycle, reduces the risk of data leaks, and ensures that identity-related software is battle-tested against global standards before reaching production.

CLI Usage
mockjutsu generate mrz_td3mockjutsu bulk mrz_td3 --count 10mockjutsu export mrz_td3 --count 10 --format jsonmockjutsu export mrz_td3 --count 10 --format csvmockjutsu export mrz_td3 --count 10 --format sql# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate mrz_td3 --maskmockjutsu bulk mrz_td3 --count 5 --mask
Python API
from mockjutsu import jutsujutsu.generate('mrz_td3')jutsu.bulk('mrz_td3', count=10)jutsu.template(['mrz_td3'], count=5)# mask=True: regulation-compliant outputjutsu.generate('mrz_td3', mask=True)jutsu.bulk('mrz_td3', count=5, mask=True)
JMeter
${__mockjutsu_mrz(mrz_td3)}# JMeter Function: __mockjutsu_mrz# Parameter 1: mrz_td3# Parameter 2: (not required for this function)# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_mrz(mrz_td3,mask)}
REST API
GET /generate/mrz_td3# → {"type":"mrz_td3","result":"...","status":"ok"}GET /bulk/mrz_td3?count=10POST /template {"types":["mrz_td3"],"count":1}# mask=true: regulation-compliant outputGET /generate/mrz_td3?mask=trueGET /bulk/mrz_td3?count=5&mask=true

Parameters

Parameter Values Description
--mask true | false Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…)

Other Languages