现有的用于解析驾驶执照信息的库?
是否有现有的 C# 库可用于解析驾驶执照中的信息?我希望直接从刷卡阅读器解析数据,因此它是一个长字符串,需要分解为其组件。我知道这是一个很大的请求,所以我对数字验证甚至许可证 ID 本身不感兴趣,我真的只想解析出名字和姓氏。我最终对所有 50 个州都感兴趣,但想先看看亚利桑那州和加利福尼亚州。
Is there an existing C# library that can be used to parse the information from a driver's license? I'm looking to parse the data directly from a swipe reader, so its a long string that needs to be broken down into it's components. I know that this is a big request, so I'm not interested in the validation of the numbers or even the license ID itself, I really just want to parse out the first and last name. I'm eventually interested in all 50 states but would like to see AZ and CA first.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我意识到这个问题很久以前就被问过;但我实际上不同意@FishBasketGordo 的观点:答案是否定的;如果您阅读这篇维基百科文章,您会看到一个非常明确指定的格式,所有美国驾驶执照(带有磁条)应该遵守 AAMVA 标准中的规定。
我个人在 JavaScript 库上做了一些工作 完全按照您的要求进行操作(提取姓名、号码,以及在我的情况下提取其他一些信息),并且在我能够测试的状态下取得了成功。不过,显然我还没有获得所有 50 个州的许可证。
无论如何,虽然我不知道您可以利用哪个库,但我仍然想权衡这个问题并建议这应该是可能的。
I realize this question was asked quite a while ago; but I actually don't agree with @FishBasketGordo that the answer is no; if you read this Wikipedia article you'll see a very clearly specified format that all U.S. driver's licenses (with magnetic stripes) supposedly adhere to, as specified in a standard by the AAMVA.
I personally have done some work on a JavaScript library to do exactly what you're asking (extract name, number, and in my case a few other bits of info) and have had success with the states I've been able to test. Obviously I haven't gotten my hands on licenses from all 50 states, though.
In any case, though I don't know of a library that you can leverage, I still wanted to weigh in on this question and suggest that this should be possible.
我没有进行详尽的搜索,但我对此有一点经验,我相信答案是“否”。驾驶执照格式因州而异,并且可能经常发生变化。但是,如果您只查找名字和姓氏,那么通过反复试验应该很容易找出答案。据我所知,大多数深度学习都没有加密。只需通过超级终端或类似的东西设置读卡器,然后查看刷卡的输出。
编辑:请参阅@Dan Tao 的回答以及有关驾驶执照格式信息的评论。现在甚至可能有一个用于解析 AAMVA 兼容许可证数据的 C# 库(据我所知,2011 年还没有),这是最初的问题,这就是我回答“否”的原因。
I haven't done an exhaustive search, but I have a little experience with this and I believe the answer is "No". Driver's licence formats vary by state and could potentially change often. However, if you're looking for just the first and last name, that should be fairly easy to figure out by trial and error. Most DL's aren't encrypted from what I've seen. Just setup your card reader through Hyperterminal or something similar and look at the output from you card swipes.
Edit: Please see @Dan Tao's answer as well as the comments for information on driver's license formats. There might even be a C# library for parsing AAMVA compliant license data now (there wasn't in 2011 to my knowledge), which was the original question, which is why I replied "No".
我不熟悉根据 https://stackoverflow.com/users/783175/fishbasketgordo 更改的驾驶执照字符串在不同的州,但碰巧你有多种选择。
I am not familiar with the driver's license strings which according to https://stackoverflow.com/users/783175/fishbasketgordo changes in various states, but it occurs to be that you have several choices.