I'm working on a JavaScript project that involves reading credit cards and driver's licenses from a USB magnetic stripe reader in keyboard emulation mode. It turns out getting credit cards working was extremely easy, as they're all in the same format. However it quickly became clear that driver's licenses are much harder, as even within a single state (CA) the format varies from one card to the next.
In any case, the goal is to take the raw data from swiping a driver's license (using a magnetic stripe reader) and extract the number from it, in a way that produces the correct number for as many U.S. states as possible (all 50 would be amazing). Worth mentioning is that I am not particularly concerned with validation, at least not at this point.
Has anyone else already done this, and packaged it all up in a library (either free or commercial) I could use? That would be awesome.
I should also note that while I'd love to see a JavaScript solution, in reality I'm open to investigating any solution, written in any language.
DRIVER'S LICENCE The licence number starts with the first letter of the last name e.g., Jane Q. Public's licence number starts with a “P”. The 9th and 10th number (separated by a dash) are the same as the last two numbers of the person's year of birth. The last two numbers indicate the day of birth.
First of all most states don't use magnetic stripe on drivers' licences, or at least that was the case in 2009: http://www.digitaldoorkeep.com/blog/tag/drivers-license-magnetic-stripe/
Finding data format for the remaining states is a matter of spending some time with google (I found this in 3 minutes: http://www.dgahouston.com/msrdata2.htm ) or actually requesting the information: it's public information.
Also read this: http://www.dgahouston.com/dlsplit1.htm - scanning licences is illegal in some states.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With