Skip to content

Fail to parse AAMVA ID from Illinois with 2003 spec #29

Description

@nate1280

When parsing an Illinois barcode that uses the 2003 AAMVA spec, I get an ArgumentOutOfRangeException thrown by the GetSubfileRecords.

Running through it manually, it attempts to parse the offset as Substring(23, 4) which results in "2901", this is incorrect, it seems it needs to be shifted left 2 characters to return "0029", with this offset it parses correctly.

offset = Convert.ToInt32(input.Substring(23, 4));

I replaced the above with the following

var offsetStart = (idCard.IssuerIdentificationNumber == IssuerIdentificationNumber.Illinois) ? 21 : 23;
offset = Convert.ToInt32(input.Substring(offsetStart, 4));

And it seems to parse correctly now.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions