Giter Site home page Giter Site logo

dlid's Introduction

DLID

This is a simple library that can extract some basic information from data retrieved from the PDF417 barcode on the back of most US driving licenses. Most licenses that feature these barcodes follow the DL/ID standard as laid out here:

The barcode encodes data such as the driver's name, address, zip code, etc.

Although the parser is by no means complete, it will currently extract:

  • First name
  • Middle name
  • Last name
  • Street
  • City
  • State
  • Country
  • Postal code
  • Sex
  • Social security number
  • Date of birth

The DL/ID standard has proven difficult for both the standards body to define and for implementors to follow. Issues encountered so far include:

  • The standard is vague, and early versions omit crucial information such as the delimiter to use in fields that contain multiple pieces of information (each state therefore chooses their own at random).
  • The standard makes senseless changes between versions, such as changing from ISO format dates (good) to US-style dates (bad) to using both formats simultaneously and choosing the format based on whether the license is issued in the US or Canada (ugly).
  • The standard mixes fixed-width and variable-width fields arbitrarily, but also includes field separators, making the fixed-width fields pointless.
  • The fixed-width fields are frequently too large for the data they contain.
  • Different versions of the standard switch from one bad field encoding scheme to another and rarely arrive at a reasonable approach.
  • South Carolinans can't read and used the wrong ASCII code as a delimiter in the data header.
  • South Carolinans can't count and their implementation of the data header has an off-by-one bug.
  • Coloradoans can't follow simple instructions and mis-ordered the data in the name field.

Usage

Fetch the package in the usual way:

go get github.com/ant512/DLID

Then import it into your source:

import "github.com/ant512/DLID/dlidparser"

Call it like so:

s, err := dlidparser.Parse("barcodedata")

Links

Email

Contact me at [email protected].

dlid's People

Contributors

ant512 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.