idscanner

Read Passport and ID Swiped as Taken From OCR Swipe Readers using the Machine Readable Zone of Passports and IDs.

Usage no npm install needed!

<script type="module">
  import idscanner from 'https://cdn.skypack.dev/idscanner';
</script>

README

ID and Passport Swipe Parser

Description

Designed for the use of Hotel/Youth Hostel/Accommodation providers. Will take the OCR string from an MRZ Scanner, for example the 3M CR100, and parse all of the data to an object containing all of the Passport/ID's personal data.

Usage

Include the idreader package like so var idscanner = require("idscanner");.

idreader has one functional method getIDData which takes the string as read from the passport/id swipe machine.

idreader has one example method returnTestData.

Example Usage

var idscanner = require("idscanner");

//ONCE YOU HAVE COLLECTED YOUR SWIPE FROM THE PASSPORT/ID SWIPE READER INSERT IT AS THE PARAMETER TO getIDData
var parsedData = getIDData("START\nOCR LINE 1: P<RUSMALBORSKYI<<KOVBOJ<<<<<<<<<<<<<<<<<<<<<\nOCR LINE 2: 7553279419RUS8712242M2104131<<<<<<<<<<<<<<02\nOCR LINE 3:\nMSR LINE 1:\nMSR LINE 2:\nMSR LINE 3:\nEND");

//TO GET AN EXAMPLE RESULT OBJECT OUT CALL returnTestData
var exampleParsedData = returnTestData();