# Passport MRZ-Visual Consistency Check and MRZ Validity

## Field Verification Result enum

| enum | Constant            | Description                              |
| ---- | ------------------- | ---------------------------------------- |
| 0    | RCF\_DISABLED       | comparison wasn't done, result undefined |
| 1    | RCF\_VERIFIED       | verification passed                      |
| 2    | RCF\_NOT\_VERIFIED  | verification failed                      |
| 3    | RCF\_Compare\_True  | positive comparison result               |
| 4    | RCF\_Compare\_False | negative comparison result               |

## Matrix In JSON Result

![Matrix Array](https://253651193-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LpQle72tz7-gm8Gk4Bg%2F-LvxyAl7d1-ZnHDQC6WA%2F-LvxyMdwDR_CWT9n8sLw%2Fimage.png?alt=media\&token=31d76a3c-5d14-44fd-be93-d5993906574d)

## Interpretation of Matrix

For MRZ data validity, look at index 0; for MRZ-VISUAL consistency check, look at index 5.

| Index | Meaning                                                          |
| ----- | ---------------------------------------------------------------- |
| 0     | MRZ data verification result                                     |
| 1     | RFID-chip data verification result                               |
| 2     | document filling text fields data verification result            |
| 3     | bar-codes data verification result                               |
| 4     | MRZ and RFID-chip data comparing result                          |
| 5     | MRZ and document filling text fields data comparing result       |
| 6     | MRZ and bar-codes data comparing result                          |
| 7     | document filling text fields and RFID-chip data comparing result |
| 8     | document filling text fields and bar-codes data comparing result |
| 9     | RFID-chip and bar-codes data comparing result                    |

## Fields To Be Checked for Data Consistency

| FieldType | FieldName           |
| --------- | ------------------- |
| 0         | Document class code |
| 1         | Issuing state code  |
| 2         | Document #          |
| 3         | Date of expiry      |
| 5         | Date of birth       |
| 12        | Sex                 |

## Fields to be Checked for Data Validity

| FieldType | FieldName                       |
| --------- | ------------------------------- |
| 80        | Check digit for document number |
| 81        | Check digit for date of birth   |
| 82        | Check digit for date of expiry  |
| 84        | Final check digit               |

## Passport MRZ Interpretation

![](https://253651193-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LpQle72tz7-gm8Gk4Bg%2F-MbissxExnPEjIXOvtW8%2F-Mbit3KUjKpG-fN3aMyV%2FMalaysia%20National%20Passport-01_front.jpg?alt=media\&token=753976f4-526b-488d-a77b-d0c27fcbad27)

| Positions | Length | Meaning                                                            |
| --------- | ------ | ------------------------------------------------------------------ |
| 1–9       | 9      | Passport number                                                    |
| 10        | 1      | Check digit over digits 1–9                                        |
| 11–13     | 3      | Nationality (ISO 3166-1 alpha-3 code with modifications)           |
| 14–19     | 6      | Date of birth (YYMMDD)                                             |
| 20        | 1      | Check digit over digits 14–19                                      |
| 21        | 1      | Sex (M, F or < for male, female or unspecified)                    |
| 22–27     | 6      | Expiration date of passport (YYMMDD)                               |
| 28        | 1      | Check digit over digits 22–27                                      |
| 29–42     | 14     | Personal number (may be used by the issuing country as it desires) |
| 43        | 1      | Check digit over digits 29–42 (may be < if all characters are <)   |
| 44        | 1      | Check digit over digits 1–10, 14–20, and 22–43                     |

{% hint style="info" %}
Download this document for details.
{% endhint %}

{% file src="<https://253651193-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LpQle72tz7-gm8Gk4Bg%2F-Lvy-p2IpdM1i9-ATr9d%2F-Lvy0DQ9HD_podIgZryh%2FInnov8tif%20%20-%20EMAS%20eKYC%20-%20Passport%20MRZ-Visual%20Consistency%20Check%20And%20MRZ%20Validity.pdf?alt=media&token=b56c8847-bd04-448d-88b6-337221c5359e>" %}
