Ë
    Ã?Æi�  ã                  óV   — d Z ddlmZ ddl­ ddlmZmZ dd„Zdd„Zdd„Z	dd„Z
dd	„Zy
)u{  eID Number (Belgian electronic Identity Card Number).

The eID is an electronic identity card (with chip), issued to Belgian citizens
over 12 years old.
The card number applies only to the card in question and should not be confused
with the Belgian National Number (Rijksregisternummer, NumÃ©ro National),
that is also included on the card.

The card number consists of 12 digits in the form xxx-xxxxxxx-yy where
yy is a check digit calculated as the remainder of dividing xxxxxxxxxx by 97.
If the remainder is 0, the check number is set to 97.

More information:

* https://www.ibz.rrn.fgov.be/nl/identiteitsdocumenten/eid/
* https://eid.belgium.be/en/what-eid
* https://www.ibz.rrn.fgov.be/fileadmin/user_upload/nl/rr/instructies/IT-lijst/IT195_Identiteitsbewijs_20240115.pdf

>>> compact('000-0011032-71')
'000001103271'
>>> compact('591-1917064-58')
'591191706458'
>>> validate('000-0011032-71')
'000001103271'
>>> validate('591-1917064-58')
'591191706458'
>>> validate('591-2010999-97')
'591201099997'
>>> validate('000-0011032-25')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> format('591191706458')
'591-1917064-58'
é    )Úannotations)Ú*)ÚcleanÚisdigitsc                óR   — t        | d«      j                  «       j                  «       S )zˆConvert the number to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.z -./)r   ÚupperÚstrip©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/be/eid.pyÚcompactr   ?   s#   € ô �˜Ó ×&Ñ&Ó(×.Ñ.Ó0Ð0ó    c                ó2   — dt        | dd «      dz  xs dz  S )zÇCalculate the expected check digits for the number, calculated as
    the remainder of dividing the first 10 digits of the number by 97.
    If the remainder is 0, the check number is set to 97.
    z%02dNé
   éa   )Úintr
   s    r   Ú_calc_check_digitsr   E   s$   € ð
 ”c˜&  "˜+Ó&¨Ñ+Ò2°Ñ3Ð3r   c                óÎ   — t        | «      } t        | «      rt        | «      dk  r
t        «       ‚t	        | «      dk7  r
t        «       ‚t        | dd «      | dd k7  r
t        «       ‚| S )zfCheck if the number is a valid ID card number.
    This checks the length, formatting and check digit.r   é   Néþÿÿÿ)r   r   r   ÚInvalidFormatÚlenÚInvalidLengthr   ÚInvalidChecksumr
   s    r   Úvalidater   M   sc   € ô �V‹_€FÜ�FÔœs 6›{¨aÒ/Ü‹oÐÜ
ˆ6ƒ{�bÒÜ‹oÐÜ˜&  "˜+Ó&¨&°°¨+Ò5ÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z6Check if the number is a valid Belgian ID Card number.F)Úboolr   ÚValidationErrorr
   s    r   Úis_validr   Z   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                óR   — t        | «      } dj                  | dd | dd | dd f«      S )z8Reformat the number to the standard presentation format.ú-Né   r   )r   Újoinr
   s    r   Úformatr$   b   s3   € ä�V‹_€FØ�8‰8�V˜B˜Q�Z ¨¨" ¨v°b°c¨{Ð;Ó<Ð<r   N)r   ÚstrÚreturnr%   )r   r%   r&   r   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r   r   r   r$   © r   r   ú<module>r,      s/   ðñ*"õH #ä ß 'ó1ó4ó
óô=r   