![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
mrz
Advanced tools
Readme
Parse MRZ (Machine Readable Zone) from identity documents.
Maintained by Zakodium
$ npm install mrz
const parse = require('mrz').parse;
const mrz = [
'I<UTOD23145890<1233<<<<<<<<<<<',
'7408122F1204159UTO<<<<<<<<<<<6',
'ERIKSSON<<ANNA<MARIA<<<<<<<<<<',
];
var result = parse(mrz);
console.log(result);
parse(mrz, [options])
Parses the provided MRZ. The argument can be an array of lines or a single string
including line breaks. This function throws an error if the input is in an
unsupported format. It will never throw an error when there are invalid fields
in the MRZ. Instead, the result.valid
value will be false
and
details about the invalid fields can be found in result.details
.
options.autocorrect
If set to true
, some ambiguous characters will be automatically corrected by the parser if the field is supposed to
only contain numeric or alphabetic characters.
For example, in a date field, the letter "O" will be converted to the number "0".
Information about autocorrected characters will be added to the result details.
Default: false
.
String identifying the format of the parsed MRZ. Supported formats are:
true
if all fields are valid. false
otherwise.
Object mapping field names to their respective value. The value is set to null
if it is invalid. The value may be different from the raw value. For example,
result.fields.sex
will be "male" when the raw value was "M".
The document number, as can be found in the visual elements of the document, outside the MRZ. For some documents, it may
be composed of multiple parsed fields. It may also not include the MRZ field named documentNumber
. If any of the used
fields is invalid, this field will be set to null
.
Array of objects describing all parsed fields. Its structure is:
result.fields
. Null for some fields such as separators that don't contain a value.null
.line
, start
, end
and raw
.line
.line
.formats
Static mapping of supported formats.
states
Static mapping of state code to state name.
https://www.icao.int/publications/pages/publication.aspx?docnum=9303
FAQs
Parse MRZ (Machine Readable Zone) from identity documents
We found that mrz demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.