New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@wubook/mrz

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wubook/mrz

Parse MRZ (Machine Readable Zone) from identity documents || PATCH

latest
Source
npmnpm
Version
2.0.18
Version published
Maintainers
1
Created
Source

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 locale = 'ES' // optional

const result = parse_mrz(ocr_text, locale)
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

Keywords

mrz

FAQs

Package last updated on 09 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts