Skip to content

False negatives in czech Rondé číslo #468

Closed
@JanC

Description

@JanC

hey there,

I noticed that some of the czech rondé číslo are validated as invalid while they are valid. 8801251680 validates as False because The number's checksum or check digit is invalid but it seems to actually be a valid rodné cislo.

https://www.martik.cz/validace-rodneho-cisla/#formular

Image

https://www.kurzy.cz/vypocet/rodne-cislo-validace/

Image

I believe the reason is explained here where it states that the this rule can also happen after a year 1985

# before 1985 the checksum could be 0 or 10
if birth_date < datetime.date(1985, 1, 1):
check = check % 10

přidělování takových rodných čísel bylo roku 1985 podle interního předpisu FSÚ Č. Vk. 2898/1985 ukončeno; není však vyloučeno, že se v minimálním počtu vyskytla i po tomto roce.

So I believe the fix would be to simply replace the above condition with

if check == 10:
    check = check % 10 # or simply check = 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions