NAME Parser::AAMVA::License - AAMVA Driver's License Magnetic Stripe Parser
DESCRIPTION
License is a parser/decoder for the American Association of Motor Vehicle Administrators(AAMVA) format that is used to encode the magnetic stripe found on Driver's Licenses in the US and Canada. Most data is available both in its raw and decoded form. You should refer to the latest specification at www.aamva.org for details on the field contents. Starting and ending sentinals in the track data are optional.
Load the tracks you have available, only track 1 is mandatory. Not all magnetic stripe readers can read track 3.
SYNOPSIS
$track1='%ORSPRINGFIELD ^ SIMPSON $HOMER$J ^ 742 EVERGREEN TERR ^?'; # % and ? are sentinals.
$track2 =';6360291234567890123=180119550512=?'; # ; and ? are sentinals.
$p = new Parse::AAMVA::License;
$p->loadtrack( 1, $track1 );
$p->loadtrack( 2, $track2 );
$p->loadtrack( 3, $track3 );
$p->parse_magstripe;
FIELDS
Field Name AAMVA Field # Track
state State/Province 2 1
city City Name 3 1
fname First Name 4 1
lname Last Name 4 1
middle Middle Name 4 1
address1 Address Line 1 5 1
address2 Address Line 2 5 1
id ISO Id 2 2
license License Number 3/7 2 Includes overflow from field 7
expdate Expiration 5 2 YYYY-MM-DD (1)
birthdate Birth Date 6 2 YYYY-MM-DD
cdsversion CDS Version 2 3
jdversion Juris. Version 3 3
postalcode Postal/Zip Code 4 3
dlclass License Class 5 3
restrictions Lic. Restrictions 6 3
endorsements Lic. Endorsements 7 3
sex Sex 1=Male, 2=Female 8 3
height Height in in. or cm. 9 3 (2)
weight Weight in lbs or kg. 10 3 (2)
haircolor Hair Color 11 3 (3)
eyecolor Eye Color 12 3
did Optionally defined by
jurisdiction 13,14,15 3
(1). If expiration date year is 2077, license never expires. Otherwise, this field represents the last valid date.
(2). Height is in inches or cm depending on country. Weight is in pounds or kg. Call the country method to determine country of origin: USA, MEX or CAN.
(3). This the raw hair color, e.g. BRO. For a description, call the haircolor method.
METHODS
- $p->loadtrack(tracknumber,string);
-
Load the magnetic stripe track
- $p->parse_magstripe
-
Parse loaded magstripe data. Returns null.
- $p->country
-
Attempts to determine country of origin from the ISO ID. Returns CAN, MEX or USA.
- $p->haircolor
-
Returns the ANSI D20 hair color definition BAL Bald BLK Black BLN Blond BRO Brown GRY Grey RED Red/Auburn SDY Sandy WHI White UNK Unknown
ACCESSING FIELDS
Decoded fields are accessed directly via an anonymous hash:
Ex. print $p->{license};
EXAMPLE
$p=new Parse:AAMVA:License;
$p->loadtrack(1,$track1);
$p->loadtrack(2,$track2);
$p->loadtrack(3,$track3);
$p->parse_magstripe;
print "Name: ".$p->{fname}.' '.$p->{lname};
print "Birth Date: ".$p->{birthdate};
AUTHOR Curt Evans, <bitflurry at gmail.com>
COPYRIGHT
Copyright Curt Evans, 2014. This program is free software; you can redistribute it and/or modify it under the terms of either: a) the GNU General Public License; either version 2 of the License, or (at your option) any later version. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA b) the Perl Artistic License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.