Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AAMVA v0 and V1 issues #1

Open
ericcumbee opened this issue Jul 10, 2018 · 3 comments
Open

AAMVA v0 and V1 issues #1

ericcumbee opened this issue Jul 10, 2018 · 3 comments
Assignees

Comments

@ericcumbee
Copy link

Hello,
I've been working on js parser for AAMVA as well. I found your's with great interest. I just wanted to let you know about a couple things.

V0 and V1 of the spec do not have a Jurisdictional Version number which throws the regex off.

i've started playing around with your code and what i am doing to solve that is grab the AAMVA Version number using substring (should be in the same place in all versions of the spec.) and using a different regex for v0/1 and then one for all of the other versions.

to further complicate that South Carolina that uses either v0 or v1 has an off by one error that has to be accounted for in parsing the subfiles.

Also some states instead of ANSI for the file type indicator use AAMVA.

and some states use \x1c instead of \x1e for the record separator.

i've been playing around with your regex (first time really using regex though) and it should be able to parse out the subfiles for V0/1
m = data.match(/^@\n\u001e|\x1c\r(ANSI |AAMVA )(\d{6})(\d{2})(\d{2})/);

Also i see you started implementing date parsing. Just a heads up even though the spec says to encode the dates in a certain format not all states follow that.

this repo https://github.com/ant512/DLID is a bit dated but the comments do a pretty good job of explaining the warts on the implementation of the spec.

@stephenquan stephenquan self-assigned this Sep 5, 2018
@stephenquan
Copy link
Owner

stephenquan commented Sep 5, 2018

Thanks for your feedback, and the suggested regex. It isn't quite right, but the information you provided is helpful to help me construct it.

@stephenquan
Copy link
Owner

@ericcumbee do you have examples of V0 and V1 codes?

@ericcumbee
Copy link
Author

Sorry for the delay i've been referencing this repo and using his test cases
https://github.com/rechner/py-aamva/blob/master/test.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants