In the realm of identity verification and digital security testing, generating realistic and compliant test data is a critical requirement for developers and QA engineers. The mrz_td1 function within the mock-jutsu library is specifically engineered to produce synthetic Machine Readable Zone (MRZ) data that adheres strictly to the ICAO 9303 Part 5 standard. This international standard defines the layout for TD1-sized identity documents, such as national ID cards, which consist of three distinct lines of thirty characters each. By using mock-jutsu, development teams can automate the creation of valid-looking document strings without the privacy risks associated with using sensitive, real-world personal information.
The mrz_td1 generator ensures high-fidelity mock data by accurately populating essential fields, including the document type code, issuing state, document number, date of birth, and expiration date. Beyond simple string concatenation, the function implements the complex modulus-10 check digit algorithms required by international civil aviation regulations. This includes individual check digits for specific data fields as well as the critical composite check digit that validates the integrity of the entire data block. This level of algorithmic precision is vital for testing Optical Character Recognition (OCR) systems and backend validation logic where structural accuracy is non-negotiable for a successful pass.
Integration into modern development workflows is seamless, whether you are working in a local environment or a large-scale CI/CD pipeline. Developers can invoke mrz_td1 through the Python API using the jutsu.generate('mrz_td1') method or utilize the command-line interface for rapid test data extraction. Furthermore, for performance and stress testing, the mock-jutsu JMeter plugin allows engineers to inject dynamic MRZ strings into automated test scripts using the ${__mockjutsu(mrz_td1,)} syntax. This versatility makes it an indispensable tool for teams building passport control software, banking KYC systems, or any application involving automated document scanning.
Utilizing the mrz_td1 function helps organizations avoid the legal and security pitfalls of using PII (Personally Identifiable Information) in non-production environments. By generating compliant mock data on the fly, developers can focus on refining their algorithms and improving software reliability. Whether you need a single JSON object for a unit test or thousands of unique records for a database seed, mock-jutsu provides a robust, standardized solution for all MRZ-related testing scenarios, ensuring your applications are prepared for the rigors of real-world document processing.
mockjutsu generate mrz_td1mockjutsu bulk mrz_td1 --count 10mockjutsu export mrz_td1 --count 10 --format jsonmockjutsu export mrz_td1 --count 10 --format csvmockjutsu export mrz_td1 --count 10 --format sql# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate mrz_td1 --maskmockjutsu bulk mrz_td1 --count 5 --maskfrom mockjutsu import jutsujutsu.generate('mrz_td1')jutsu.bulk('mrz_td1', count=10)jutsu.template(['mrz_td1'], count=5)# mask=True: regulation-compliant outputjutsu.generate('mrz_td1', mask=True)jutsu.bulk('mrz_td1', count=5, mask=True)${__mockjutsu_mrz(mrz_td1)}# JMeter Function: __mockjutsu_mrz# Parameter 1: mrz_td1# Parameter 2: (not required for this function)# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_mrz(mrz_td1,mask)}GET /generate/mrz_td1# → {"type":"mrz_td1","result":"...","status":"ok"}GET /bulk/mrz_td1?count=10POST /template {"types":["mrz_td1"],"count":1}# mask=true: regulation-compliant outputGET /generate/mrz_td1?mask=trueGET /bulk/mrz_td1?count=5&mask=true| Parameter | Values | Description |
|---|---|---|
| --mask | true | false | Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…) |