drivers_license_parser 2.0.0

SDKdartflutter
Platformandroidioswindowslinuxmacosweb

This package provides a simple and effective utility for parsing barcodes displayed on the back of drivers license cards issued in the United States and Canada.

LicenseParser

Note: This is a Dart port of https://github.com/ksoftllc/license-parser

Easily parse the information within PDF-417 barcodes found on the back of US and Canadian driver's licenses adhering to the AAMVA Version 8. This library also supports all older standards as well. standard.

Usage


// First get the PDF-417 barcode data by scanning the barcode on the license
// this step can be done any way you like and is not provided by this library
final pdf417Data = myLicenseScannerUtility.scan();

// Parse the data with the LicenseParser
final parsedLicense = LicenseParser.parse(pdf417Data);

// use the parsedLicense as you wish
print(parsedLicense.firstName);
// => "John"
print(parsedLicense.middleName);
// => "Quincy"
print(parsedLicense.lastName);
// => "Public"

AAMVA Standard

Supported Fields

NameDescriptionTypeParsedLicense Attribute
First NameCustomer First NameStringfirstName
Last NameCustomer Last NameStringlastName
Middle NameCustomer Middle NameStringmiddleName
Expiration DateDocument Expiration DateNSDateexpirationDate
Issue DateDocument Issue DateNSDateissueDate
Date of BirthCustomer Date of BirthNSDatedateOfBirth
GenderCustomer GenderEnumgender
Eye ColorCustomer Eye ColorEnumeyeColor
Hair ColorCustomer Hair ColorEnumhairColor
HeightCustomer Height (in inches)Doubleheight
Street AddressCustomer Street AddressStringstreetAddress
Second Street AddressCustomer Street Address Line 2StringstreetAddressSupplement
CityCustomer CityStringcity
StateCustomer StateStringstate
Postal CodeCustomer Postal CodeStringpostalCode
Customer IDUnique Customer ID NumberStringcustomerId
Document IDUnique Document ID NumberStringdocumentId
Issuing CountryIssuing CountryEnumissuingCountry
Middle Name TruncationWas Middle Name truncated?EnummiddleNameTruncation
First Name TruncationWas First Name truncated?EnumfirstNameTruncation
Last Name TruncationWas Last Name truncated?EnumlastNameTruncation
Place of BirthCountry and municipality and/or state/provinceStringplaceOfBirth
Audit InformationA string of letters and/or numbers that identifies when, where, and by whom a driver license/ID card was made.StringauditInformation
Inventory ControlA string of letters and/or numbers that is affixed to the raw materials (card stock, laminate, etc.) used in producing driver licenses and ID cards.StringinventoryControlNumber
Last Name AliasOther Last Name by which cardholder is known.StringlastNameAlias
First Name AliasOther First Name by which the cardholder is known.StringfirstNameAlias
Suffix AliasOther suffix by which cardholder is knownStringsuffixAlias
Name SuffixName SuffixEnumsuffix

AAMVA Element IDs

Below is a table of AAMVA Element Ids and the fields to which they map by AAMVA Version.

bold = Mandatory Field

-- = not included in this version of the standard

FieldVersion 1Version 2Version 3Version 4Version 5Version 6Version 7Version 8Version 9Version 10Supported
First NameDACDCTDCTDACDACDACDACDACDACY
Last NameDABDCSDCSDCSDCSDCSDCSDCSDCSY
Middle NameDADDADDADDADDADDADDADDADDADY
Expiration DateDBADBADBADBADBADBADBADBADBAY
Issue DateDBDDBDDBDDBDDBDDBDDBDDBDDBDY
Date of BirthDBBDBBDBBDBBDBBDBBDBBDBBDBBY
GenderDBCDBCDBCDBCDBCDBCDBCDBCDBCY
Eye ColorDAYDAYDAYDAYDAYDAYDAYDAYDAYY
Height (inches)DAUDAUDAUDAUDAUDAUDAUDAUDAUY
Street AddressDAGDAGDAGDAGDAGDAGDAGDAGDAGY
CityDAIDAIDAIDAIDAIDAIDAIDAIDAIY
StateDAJDAJDAJDAJDAJDAJDAJDAJDAJY
Postal CodeDAKDAKDAKDAKDAKDAKDAKDAKDAKY
Customer IDDBJDAQDAQDAQDAQDAQDAQDAQDAQY
Document ID--DCFDCFDCFDCFDCFDCFDCFDCFY
Issuing Country--DCGDCGDCGDCGDCGDCGDCGDCGY
Middle Name Truncation--DDG--DDGDDGDDGDDGDDGDDGY
First Name Truncation--DDF--DDFDDFDDFDDFDDFDDFY
Last Name Truncation--DDE--DDEDDEDDEDDEDDEDDEY
Second Street AddressDAHDAHDAHDAHDAHDAHDAHDAHDAHY
Hair ColorDAZDAZDAZDAZDAZDAZDAZDAZDAZY
Place of Birth----DCIDCIDCIDCIDCIDCIDCIY
Audit Information----DCJDCJDCJDCJDCJDCJDCJY
Inventory Control----DCKDCKDCKDCKDCKDCKDCKY
Last Name AliasDBODBNDBNDBNDBNDBNDBNDBNDBNY
First Name AliasDBPDBGDBGDBGDBGDBGDBGDBGDBGY
Suffix AliasDBR--DBSDBSDBSDBSDBSDBSDBSY
Name SuffixDBNDCUDCUDCUDCUDCUDCUDCUDCUY

Example of a raw driver's license payload

Version 8 Example License Data

@

ANSI 636026080102DL00410288ZA03290015DLDAQD12345678
DCSPUBLIC
DDEN
DACJOHN
DDFN
DADQUINCY
DDGN
DCAD
DCBNONE
DCDNONE
DBD08242015
DBB01311970
DBA01312035
DBC1
DAU069 in
DAYGRN
DAG789 E OAK ST
DAIANYTOWN
DAJCA
DAK902230000  
DCF83D9BN217QO983B1
DCGUSA
DAW180
DAZBRO
DCK12345678900000000000
DDB02142014
DDK1
ZAZAAN
ZAB
ZAC

Installation

install through pub

pub add drivers_license_parser

Contributing

Guidelines

  • Write tests
  • Leave the code better than when you found it
  • Add or improve documentation
  • Small and frequent commits
  1. Fork the repository
  2. Submit a pull request
  3. Become a contributor once the pull request is accepted!

License

DriversLicenseParser is available under the MIT license. See the LICENSE file for more info.