Code Monkey home page Code Monkey logo

Comments (9)

fabiocaccamo avatar fabiocaccamo commented on May 25, 2024

@stef-iula do you have any idea regarding how to solve this problem?

from python-codicefiscale.

stef-iula avatar stef-iula commented on May 25, 2024

@fabiocaccamo to be honest I haven't looked yet into your code nor in any of the other packages that do this to understand how to fix the issue, but I'll keep you posted! I opened the issue because I think it's good to have a reference!

from python-codicefiscale.

fabiocaccamo avatar fabiocaccamo commented on May 25, 2024

@stef-iula my question doesn't require that you read the code, because the problem is that from the "Codice Fiscale" it is possible to obtain only the last 2 digits of the year, so it is impossible to distinguish if 21 means 1921 or 2021.
For this reason I decided to give priority to the more recent year in these cases.

from python-codicefiscale.

stef-iula avatar stef-iula commented on May 25, 2024

I am aware of how it works and the fact that this basically has to be modulo 100 yrs but I tried one of these corner cases on this website https://www.codicefiscale.com/inverso.php and it worked properly so I was wondering if there's a way solving it.

from python-codicefiscale.

fabiocaccamo avatar fabiocaccamo commented on May 25, 2024

Using https://www.codicefiscale.com/inverso.php try to generate your own CF twice, the first time with birthdate year 1921 and the second time with year 2021, you will obtain the same code... Probably they do just the opposite (they do precedence to the older year), but the problem is the same.

from python-codicefiscale.

stef-iula avatar stef-iula commented on May 25, 2024

I tried decoding several times the CF that gave me problems (I can't share for privacy reasons) and I always got the right result -- 1921 as birth year.

from python-codicefiscale.

fabiocaccamo avatar fabiocaccamo commented on May 25, 2024

Sure, but if you would decode the code of a child born in 2021, you will obtain 1921 anyway, there is not solution.

from python-codicefiscale.

stef-iula avatar stef-iula commented on May 25, 2024

I see.. well, hopefully it's about corner cases so I'd better find a way to handle them in my app. Thanks a lot for the discussion, closing this since there appears to be no solution :)
Cheers!

from python-codicefiscale.

fabiocaccamo avatar fabiocaccamo commented on May 25, 2024

Yes, it is really a corner case.

from python-codicefiscale.

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.