Download the PHP package rakibdevs/mrz-parser without Composer

On this page you can find all versions of the php package rakibdevs/mrz-parser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mrz-parser

MRZ (Machine Readable Zones) Parser for PHP

Latest Version on Packagist Tests PHP Version Total Downloads

A PHP package for MRZ (Machine Readable Zones) code parser for Passport, Visa & Travel Document (TD1 & TD2).

It reads the machine-readable zone, extracts the document fields, and — new in v2 — verifies the ICAO 9303 check digits so you can tell whether the data is internally consistent.

Requirements

Installation

You can install the package via composer:

Usage

Output

Check-digit validation

Every result carries a valid flag (overall) and a validation map with the outcome of each ICAO 9303 check digit (card_no, date_of_birth, date_of_expiry, personal_number for passports, and the composite). Visas carry no composite check digit, so their validation map omits it. Use these to reject OCR mistakes or tampered documents.

Input handling

Input is normalized before parsing: \r\n / \r line endings are converted to \n, surrounding whitespace is trimmed, and blank lines are dropped — so MRZ strings copied from Windows or OCR output parse the same as clean input. Dates are validated strictly (impossible dates such as Feb 30 return null), and a date of birth that would resolve to the future is shifted back a century.

Advanced usage

Typed result object

read() returns an MrzResult value object with typed properties and helpers, while toArray() gives you the same array as parse():

Non-throwing parsing

parse()/read() throw on unrecognised input. Use the try* variants to get null instead:

Strict check-digit mode

Pass strict: true to reject documents whose check digits don't verify (throws InvalidChecksumException; the try* variants return null):

Name transliteration

The MRZ name field only holds A–Z. Convert a visual-zone (accented) name to its MRZ form, or compare the two:

Laravel

The package ships an auto-discovered service provider and a validation rule (requires illuminate/support):

Supported Document

Passport (TD3)

Visa

Or

Travel Document (TD1)

Travel Document (TD2)

French National ID (legacy 2×36 Carte Nationale d'Identité)

This pre-2021 format predates ICAO TD1/TD2 and has its own layout (no expiry date is encoded).

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

Special thanks to tetrahydra for organised country list, Al Amin for help extracting information.

License

The MIT License (MIT). Please see License File for more information.


All versions of mrz-parser with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rakibdevs/mrz-parser contains the following files

Loading the files please wait ...