Skip to content
/ mDowod Public

The repository contains methods for validating Polish ID card numbers, in particular for the new electronic mDowodu (mDowod)

License

Notifications You must be signed in to change notification settings

SebiBin/mDowod

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

mDowod

mDowΓ³d - sprawdzanie poprawnoΕ›ci cyfry kontrolnej

[TOC]

Metoda IsDocumentNumberCorrect w plikach src/mDowod-validator.js (javascript) oraz DocumentNumberValidator.cs (C#)

Sprawdza czy cyfra kontrolna numeru Dowodu / mDowodu / Paszportu / Karty pobytu jest poprawna.

Zgodna ze specyfikacjami ISO/IEC 7501-1:1997, ICAO 9303 https://www.icao.int/Meetings/TAG-MRTD/TagMrtd22/TAG-MRTD-22_WP03-rev.pdf strona 21 ICAO 9303-3 https://www.icao.int/publications/Documents/9303_p3_cons_en.pdf#search=9303%2D3 strona 19

Algorytm liczenia cyfry kontrolnej mDowodu, Dododu, Paszportu, Karty pobytu

Literom przypisujemy liczby:
 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”  
 |A ⁞B ⁞C ⁞ D⁞ E⁞ F⁞ G⁞ H⁞ I⁞ J⁞ K⁞ L⁞ M⁞ N⁞ O⁞ P⁞ Q⁞ R⁞ S⁞ T⁞ U⁞ V⁞ W⁞ X⁞ Y⁞ Z |
 |10⁞11⁞12⁞13⁞14⁞15⁞16⁞17⁞18⁞19⁞20⁞21⁞22⁞23⁞24⁞25⁞26⁞27⁞28⁞29⁞30⁞31⁞32⁞33⁞34⁞35 |
 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” 
Algorytm obliczenia cyfry kontrolnej (CK) dla serii MAAA i numeru kolejnego 23456

  β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” 
 |Dane      ⁞  M     A    A    A  CK   2    3    4    5 ⁞     |
 |WartoΕ›ci  ⁞  22   10   10   10  β–«β–«   2    3    4    5 ⁞     |
 |Wagi      ⁞   7    3    1    7  β–«β–«   3    1    7    3 ⁞     |
 |Iloczyny  ⁞ 154   30   10   70  β–«β–«   6    3   28   15 ⁞     |
 |β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”|
 |Sumowanie ⁞ 154 + 30 + 10 + 70     + 6  + 3 + 28 + 15 = 316 |
  β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” 

 (22β€’7)+(10β€’3)+(10β€’1)+(10β€’7)+(2β€’3)+(3β€’1)+(4β€’7)+(5β€’3) = 316
 CK ↣ 316 MOD 10 = 6

Reszta z dzielenia 316 MOD 10 = 6  
Reszta z dzielenia stanowi cyfrΔ™ kontrolnΔ… i umieszczamy jΔ… za literami serii
Otrzymujemy: MAAA 6 2345

Uwagi

Autor wykonaΕ‚ testy dostΔ™pnych mu numerΓ³w mDowodu w dostΔ™pnej wersji aplikacji mObywatel 2.0 w lipcu 2023.

About

The repository contains methods for validating Polish ID card numbers, in particular for the new electronic mDowodu (mDowod)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published