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

checkdigit handling #20

Open
ZsBT opened this issue Sep 24, 2017 · 1 comment
Open

checkdigit handling #20

ZsBT opened this issue Sep 24, 2017 · 1 comment
Labels

Comments

@ZsBT
Copy link
Owner

ZsBT commented Sep 24, 2017

As mentioned in #15 (comment) , what if we left the boolean validDateofBirth name in the result object as is, and introduced a new property "validCheckDigit" in MrzDate?
Thus, validDateofBirth would mean there is something wrong: parse error and/or failed check digit validation. Shall we are interested in the exact cause, we can inspect further with isValidDate() and validCheckDigit of the MrzDate object.
What do you think, does it make sense or it is overcomplicated now?

@ZsBT ZsBT added the question label Sep 24, 2017
@GoUpNorth
Copy link
Contributor

Hi,
I agree with you on the fact that we need two different flags to differentiate the date validity status, and the date checkdigit status.

However, I think that the checkdigit flags shoud remain at the MrzRecord level, since they are related to the MRZ, and not to the dates or to the document numbers (there also is an checkdigit for the optional number in the MRTD TD3 MRZ).
Also, if you want to put the checkdigit flag at the object level for the MrzDate, you will have to create another object for the document number and the optional, only to store that checksum flag.
And the only object for which you need a validity flag is the date, since you can't verify that a document number is valid (apart frrom checking that it only contains capitalized letters and digits of course, but that is common to all the fields in the MRZ).

To summarize I would put the validity flag at the date level, and the checkdigit flag at the MrzRecord level.

P-A

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

No branches or pull requests

2 participants