Comments (9)
@stef-iula do you have any idea regarding how to solve this problem?
from python-codicefiscale.
@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.
@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.
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.
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.
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.
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.
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.
Yes, it is really a corner case.
from python-codicefiscale.
Related Issues (20)
- Wrong birthplace code error (missing date-range in the data-source). HOT 11
- Wrong validity check after 0.5.0 version HOT 2
- Get all cities/nations names HOT 8
- Number of omocodes HOT 7
- Add check commad in the cli HOT 1
- Date Formats HOT 1
- 💡 Add this project to awesome-italia-opensource HOT 2
- Add command line usage support. HOT 1
- Allow access to data files when running in a frozen environment (eg. executable). HOT 1
- Decode ritorna GIRGENTI (soppresso) invece di AGRIGENTO HOT 4
- Issue with Incorrect Validation of Valid 'Codice Fiscale' HOT 5
- Unactive municipalities cannot be retrieved HOT 2
- `codicefiscale.is_valid` with invalid birthplace codes throw TypeException exception HOT 1
- Code Z118 (Jugoslavia) not recognised, in general file countries.json don't manage deleted countries HOT 8
- Wrong code (L884 for Vignola [TN]) used instead of L885 when encoding a person born in Vignola (MO) HOT 4
- Add type hints.
- Unable to encode and decode fiscal codes when year of birth (excluding century) < 10 (eg. 2004) HOT 8
- wrong tag/release links in CHANGELOG.md HOT 1
- Gcode HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-codicefiscale.