2.0.14 • Published 7 months ago

@wubook/mrz v2.0.14

Weekly downloads
-
License
-
Repository
github
Last release
7 months ago

Parse MRZ info from some ocr'ed text

Install

  npm i @wubook/mrz

Example

import { parse_mrz } from "@wubook/mrz"

const MRZ_ES = [
  "IDESPBAE112233612345678Z<<<<<<",
  "8309204M2510273ESP<<<<<<<<<<<3",
  "JUANITO<JUANO<<JUANES<<<<<<<<<",
]

const result = parse_mrz(ocr_text)
console.log(result)

/**
{
  _meta: { 
    mrz_size: 1, 
    ocr: { 
      raw: ["IDESPBAE112233612345678Z<<<<<<","8309204M2510273ESP<<<<<<<<<<<3","JUANITO<JUANO<<JUANES<<<<<<<<<"], 
      fixed: ["IDESPBAE112233612345678Z<<<<<<","8309204M2510273ESP<<<<<<<<<<<3","JUANITO<JUANO<<JUANES<<<<<<<<<"]
    } 
  },
  name: 'Juanes',
  surname: 'Juanito Juano',
  birthday: 432856800,
  gender: 'm',
  citizenship: 'ES',
  doc_type: 'i',
  doc_number: '12345678Z',
  doc_country: 'ES',
  doc_expiry: 1761519600,
  doc_issue: null,
  optional1: 'BAE112233',
  optional2: '',
  score: 100,
  checks: {
    name: true,
    birthday: true,
    gender: true,
    citizenship: true,
    doc_type: true,
    doc_number: true,
    doc_country: true,
    doc_expiry: true,
    doc_issue: null,
    optional1: true,
    optional2: true,
    composite: true
  }
}
**/

Prior version 1.0.0

Originally forked from https://github.com/cheminfo/mrz.

Updates added:

  • patch for FR documents
  • stripped out unnecessary exports (states, formats)
  • smart clean and pre-parse MRZ lines for better results
  • return document data using WB style
  • build with rollup
2.0.13

7 months ago

2.0.14

7 months ago

2.0.11

9 months ago

2.0.12

7 months ago

2.0.10

9 months ago

2.0.7

11 months ago

2.0.6

12 months ago

2.0.9

11 months ago

2.0.8

11 months ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.0

4 years ago