-
Notifications
You must be signed in to change notification settings - Fork 125
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
Optional data hash is checked even if optional data is empty #21
Comments
Hi @mjl First I'd like to apologize for being late to reply. I've been (almost) offline for a few days. Mmmm no. That should not happen. In the examples you have shown, I'm almost sure this didn't happen before, so there is surely an error. Some things have been changed and one bug may have occurred in the process, although I find it strange that it was not detected with unittests Please, allow me a few days to investigate it. Regards |
I had already gone to bed but I could not resist and i have checked it xDD ICAO specs for
So it's an obvious BUG I will try to fix it as soon as I can Thanks! |
Fixed (at least part 1). The problem is that ICAO is ambiguous in its specifications, leaving the application of the rules at each State. In this case, most countries choose to use The bug for Checker is fixed: from mrz.checker.td3 import TD3CodeChecker
mrz_a = ("P<CANMARTIN<<SARAH<<<<<<<<<<<<<<<<<<<<<<<<<<\n"
"ZE000509<9CAN8501019F2301147<<<<<<<<<<<<<<08")
mrz_b = ("P<CANMARTIN<<SARAH<<<<<<<<<<<<<<<<<<<<<<<<<<\n"
"ZE000509<9CAN8501019F2301147<<<<<<<<<<<<<<<8")
print(TD3CodeChecker(mrz_a))
print(TD3CodeChecker(mrz_b)) Output:
The problem with Generator remains. Actually, when mrz code is generated, if |
Wow, thanks for the quick fix. Note however that the issue is not worth losing sleep on :-) |
Heh, note that your test is wrong, it should end with '<<8' if you want to test for optional hash == '<'
|
Ooops! Was a typo. Commited. I'll push it when i'm done with what i'm doing. Thank you! |
I can confirm that this is/was (present in release 0.5.8) an issue also with German passports. I found a sample German passport here (Which I found from this site). Furthermore I have tested it with an actual German passport. Your commit seems to resolve the issue, thanks for that! I have one question though, when can we expect this fix to land in a release? |
Hi! Yes, that bug was in versions =<0.5.8. The next version has not yet been released due to some changes i'm working on now. I commited changes a few days ago, so, cloning repo now should work: from mrz.checker.td3 import TD3CodeChecker
print(TD3CodeChecker("P<D<<MUSTERMANN<<ERIKA<<<<<<<<<<<<<<<<<<<<<<\n"
"C01XYCCG91D<<6408125F2702283<<<<<<<<<<<<<<<8"))
print(TD3CodeChecker("P<D<<MUSTERMANN<<ERIKA<<<<<<<<<<<<<<<<<<<<<<\n"
"C01XYCCG91D<<6408125F2702283<<<<<<<<<<<<<<08")) Output:
Best regards! |
v0.6.1 has been released. This bug is fixed for MRZ Checker If you prefer can use Pypi |
Thanks for the hard work! |
While working with austrian ID cards and passports, I noticed that many of them fail the "optional data hash" check. For example (name and ID number redacted):
and
I suppose, that should not be checked if there is no
optional_data
and/or if theoptional_data_hash
is '<'?The text was updated successfully, but these errors were encountered: