Giter Club home page Giter Club logo

Comments (3)

Arg0s1080 avatar Arg0s1080 commented on May 27, 2024

Yes, it's correct. That should not happen.

As ICAO 9303-3 3.4 says:
"The name of the holder is usually represented in two parts, the primary identifier and the secondary identifier."

So I think that the right thing to do, in case of getting only one identifier, would be to report it as a warning.

Also, thanks to your report, I discovered that something similar happens in mrz.generator. When the primary identifier is not given, an incorrect output is got. For example:

from mrz.generator.td3 import TD3CodeGenerator

print(TD3CodeGenerator("P",           # Document type
                       "Utopia",      # Country
                       "",            # Surname(s)
                       "Anna María",  # Given name(s)
                       "L898902C3",   # Passport number
                       "UTO",         # Nationality
                       "740812",      # Birth date
                       "F",           # Genre
                       "120415",      # Expiry date
                       "ZE184226B"))  # Id number

This wrong output is got:

P<UTO<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<<<<<<<<<
L898902C36UTO7408122F1204159ZE184226B<<<<<10

Next week I'll work to try to fix it

Thank you very much for your feedback

from mrz.

tahajahangir avatar tahajahangir commented on May 27, 2024

Thanks,
Also, the first example MRZ, is an instance of another false-positive, where optional data hash fails when optional-data is empty (all <) and optional-data-hash is < (instead of 0). I think it may be an error according to specs, but exists in real-world.

from mrz.

Arg0s1080 avatar Arg0s1080 commented on May 27, 2024

@tahajahangir , hi again!

_fields method at the beginning was very simple... then, little by little, I added more checks. That's why it had several errors. I almost rewritten it from scratch. I've tested it again and I think it works fine now, but if you find something wrong, I would appreciate it if you told me

Thank you so much!

PS: I have created a new issue with the 2nd problem you have reported.

from mrz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.