nrb-qr-parser
v0.2.2
Published
Reads QR Code string from Malawi Registration National Bureau Identification document and converts it to a json format
Downloads
23
Maintainers
Readme
About NRB QR PARSER
Converts data scanned from an NRB QR code and converts it to a JSON Object format
Install
npm install nrb-qr-parser
Usage
import { parseNrbQr } from "nrb-qr-parser"
const qrString ='03~i<mwi0M3Y181AJ8<<<<<<<<<<<<<<<~6903158m2503158mwi<<<<<<<<<<<0~Dude<<Lambda<lambda<<<<<<<<<<<<<~Dude~ M3Y181AJ~Lambda~lambda~mALE~15 mAR 1989~23 jUN 2017~'
const data = parseNrbQr(qrString)
if (data) {
console.log(data.docType)
console.log(data.identifier)
console.log(data.given_name)
console.log(data.family_name)
console.log(data.gender)
console.log(data.birthdate)
console.log(data.registration_date)
}
Generated output example
{
"docType": "Malawi National ID",
"given_name": "Dude",
"family_name": "Lambda",
"identifier": "M3Y181AJ",
"birthdate": "1989-03-15",
"gender": "Male",
"registration_date": "2017-06-23"
}
Supported NRB QR code types
- National ID
- Birth certificate
- Death certificate
- Registration receipt
- Registration sticker