Ë
    Ã?Æ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   IN (å€‹äººç•ªå�·, kojin bangÅ�, Japanese Individual Number).

The Japanese Individual Number (å€‹äººç•ªå�·, kojin bangÅ�), often referred to as My
number (ãƒžã‚¤ãƒŠãƒ³ãƒ�ãƒ¼, mai nambÄ�), is assigned to identify citizens and residents.
The number consists of 12 digits where the last digit is a check digit. No
personal information (such as name, gender, date of birth, etc.) is encoded
in the number.

More information:

 * https://en.wikipedia.org/wiki/Individual_Number
 * https://digitalforensic.jp/2016/03/14/column404/

>>> validate('6214 9832 0257')
'621498320257'
>>> validate('6214 9832 0258')
Traceback (most recent call last):
  ...
InvalidChecksum: ...
>>> validate('6214 9832 025X')
Traceback (most recent call last):
  ...
InvalidFormat: ...
>>> format('621498320257')
'6214 9832 0257'
é    )Úannotations)Ú*)ÚcleanÚisdigitsc                ó6   — t        | d«      j                  «       S )zˆConvert the number to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.z- )r   Ústrip©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/jp/in_.pyÚcompactr   6   s   € ô �˜Ó×$Ñ$Ó&Ð&ó    c                ób   — d}t        d„ t        || «      D «       «      }t        | dz  dz  «      S )zZCalculate the check digit. The number passed should not have
    the check digit included.)é   é   é   é   é   é   r   r   r   r   r   c              3  ó>   K  — | ]  \  }}|t        |«      z  –— Œ y ­w)N)Úint)Ú.0ÚwÚns      r   ú	<genexpr>z#calc_check_digit.<locals>.<genexpr>@   s   è ø€ Ò8™4˜1˜aˆA”�A“�JÑ8ùs   ‚é   é
   )ÚsumÚzipÚstr)r
   ÚweightsÚss      r   Úcalc_check_digitr"   <   s5   € ð 0€GÜÑ8¤3 w°Ó#7Ô8Ó8€AÜ�ˆr�B‰w˜‰|ÓÐr   c                ó²   — t        | «      } t        | «      dk7  r
t        «       ‚t        | «      s
t	        «       ‚t        | dd «      | d   k7  r
t        «       ‚| S )zICheck if the number is valid. This checks the length and check
    digit.é   Néÿÿÿÿ)r   ÚlenÚInvalidLengthr   ÚInvalidFormatr"   ÚInvalidChecksumr	   s    r   Úvalidater*   D   sV   € ô �V‹_€FÜ
ˆ6ƒ{�bÒÜ‹oÐÜ�FÔÜ‹oÐÜ˜˜s ˜Ó$¨¨r©
Ò2ÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z"Check if the number is a valid IN.F)Úboolr*   ÚValidationErrorr	   s    r   Úis_validr.   Q   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                óR   — t        | «      } dj                  | dd | dd | dd f«      S )zLReformat the number to the presentation format found on
    My Number Cards.ú r   r   é   r$   )r   Újoinr	   s    r   Úformatr3   Y   s:   € ô �V‹_€FØ�8‰8Ø	��!ˆ�f˜Q˜q�k 6¨!¨B <Ð0ó2ð 2r   N)r
   r   Úreturnr   )r
   r   r4   r,   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r"   r*   r.   r3   © r   r   ú<module>r:      s.   ðñ*õ6 #ä ß 'ó'óó
óô2r   