NationalIDField is not correct

#2 · closed · 7 comments

View on GitHub ↗

hturkoz

Hi, NationalIDField is not correct after this : var nationalIDNumber : String { let checksum = 97 - (1000 * Int(BasicInfo.nationalIDNumberFormatter.string(from: birthday))! + Int(birthNumber)) % 97 return BasicInfo.nationalIDNumberDottedFormatter.string(from: birthday) + "-\(birthNumber).\(checksum)" } i have yymmdd-xxxx. : "-" replace a chiffre of my NationalIdNumber When return only "return nationalIdNumber", the NationalIdNumber it's correct. my eid is from date issued : 2015 Regards

Comments

Dev1an

Hey thanks for sharing this bug! Could you add a pull request with the corrected code or specify the problem a bit more precisely, because I think I don't understand the problem. Normally nationalIDNumber returns a string in the following format `01.11.99-234.56`. What does it return for your card? Is it just the dots/dashes that need to change or are there wrong digits? Also feel free to answer in French if that's easier for you.

hturkoz

<img width="281" alt="capture d ecran 2017-03-03 a 12 43 30" src="https://cloud.githubusercontent.com/assets/6090685/23550035/44af3d68-000f-11e7-8d63-16d24393bfee.png"> Bonjour Damiaan, Malheureusement je ne sais pas utiliser GitHub.. ni pullrequest. La fonction qui formate le nationalIDNumber chez moi remplace un chiffre par un - Ainsi : yymmddxxxxx (5 x) print => yymmdd-xxxx. (4 x) Comme tu peux le voir, on pert le premier chiffre après yymmdd Dans la fonction ci-haut : var nationalIDNumber : String { return nationalIDNumber } Et j'ai mon correct nationalIdNumber like yymmddxxxxx. (5 x) Cordialement. Edit : peut-être a cause de mon numero eid : yymm3001358 J'ai deux 0 qui se suivent. Sorry, je commence seulement a utiliser Xcode et swift (je suis plus php, node, c#..)

Dev1an

OK I see, I think I forgot to add leading zeros. Is it possible that the missing digit, in your case, is a zero?

hturkoz

Hi, Yes it's a zero, I have update my precedent post. Thanks many

Dev1an

I have updated the code and the updated version (1.0.13) of the application is available on the app store as of today. Can you verify that your problem is resolved? Also feel free to give this project a star ⭐ if you like it.

hturkoz

Hi Damiaan, Yes, your code have resolved the issue :). I can see all my nationalIDNumber Can we speak about a enhancement.. make a Pin Status and a Pin Verification. Get the certificate.. or can you guide me how implement this.. or have you any information (pdf, howto) for make that. Regards 2017-03-04 14:17 GMT+01:00 Damiaan Dufaux <[email protected]>: > I have updated the code and the updated version (1.0.13) of the > application is available on the app store as of today. Can you verify that > your problem is resolved? > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/Dev1an/eID-Reader/issues/2#issuecomment-284150972>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AFzvve-XADP4uv2dQ4LE2M15vqsI5ne0ks5riWRZgaJpZM4MRj-d> > . >

Dev1an

OK. For feature requests create a new issue. I already created one for you now: issue #3 .