Closed KlaasJelmer closed 3 years ago
Hi there!
Could you give an example?
I have done the following test:
from mrz.checker.td3 import TD3CodeChecker
# Case 1: Optional Data "<<<<<<<<<<<<<<", hash "0"
check1 = ("P<GB<MARTIN<<SARAH<<<<<<<<<<<<<<<<<<<<<<<<<<\n"
"980XG47<<9GBR8501019F2612281<<<<<<<<<<<<<<06")
# Case 2 Optional Data "<<<<<<<<<<<<<<", hash "<"
check2 = ("P<GB<MARTIN<<SARAH<<<<<<<<<<<<<<<<<<<<<<<<<<\n"
"980XG47<<9GBR8501019F2612281<<<<<<<<<<<<<<<6")
# Case 3 Optional Data "<<<<<<<<<<<<<<", hash "7"
check3 = ("P<GB<MARTIN<<SARAH<<<<<<<<<<<<<<<<<<<<<<<<<<\n"
"980XG47<<9GBR8501019F2612281<<<<<<<<<<<<<<76")
print(TD3CodeChecker(check1))
print(TD3CodeChecker(check2))
print(TD3CodeChecker(check3))
And its output is:
True
True
False
Is true that has_is_ok()
function returns False
, but that problem as it happened later was solved in optional_data_hash
property.
I recognize that as you suggest this problem should be solved in hash_is_ok()
(i take note)
Greetings
Hi!
I have a Swiss passport with a MRZ in the TD3 format. On this document no optional data is used, hence its MRZ value is
<<<<<<<<<<<<<<
. The corresponding optional data hash is<
.I would expect that this would result in a valid MRZ readout, but this seems not the case. The empty values are not recognized as a valid value-hash pair:
hash_is_ok("<<<<<<<<<<<<<<", "<")
returnsFalse
. This in turn causesTD3CodeChecker(mrz)
to cast to aFalse
boolean.