Ë
    Ã?Æii  ã                  óŒ   — d Z ddlmZ ddlZddlmZ ddl­ ddlmZ  ej                  d«      Z
	 dd„Zdd	„Zdd
„Zdd„Zdd„Zy)aÉ  Aadhaar (Indian personal identity number).

Aadhaar is a 12 digit identification number that can be obtained by Indian
citizens, non-residents passport holders of India and resident foreign
nationals. The number is issued by the Unique Identification Authority of
India (UIDAI).

Aadhaar is made up of 12 digits where the last digits is a check digit
calculated using the Verhoeff algorithm. The numbers are generated in a
random, non-repeating sequence and do not begin with 0 or 1.

More information:

* https://en.wikipedia.org/wiki/Aadhaar
* https://web.archive.org/web/20140611025606/http://uidai.gov.in/UID_PDF/Working_Papers/A_UID_Numbering_Scheme.pdf

>>> validate('234123412346')
'234123412346'
>>> validate('234123412347')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('123412341234')  # number should not start with 0 or 1
Traceback (most recent call last):
    ...
InvalidFormat: ...
>>> validate('643343121')
Traceback (most recent call last):
    ...
InvalidLength: ...
>>> validate('222222222222')  # number cannot be a palindrome
Traceback (most recent call last):
    ...
InvalidFormat: ...
>>> format('234123412346')
'2341 2341 2346'
>>> mask('234123412346')
'XXXX XXXX 2346'
é    )ÚannotationsN)Úverhoeff)Ú*)Úcleanz^[2-9][0-9]{11}$c                ó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    úY/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/in_/aadhaar.pyÚcompactr   J   s   € ô �˜Ó×$Ñ$Ó&Ð&ó    c                óÞ   — t        | «      } t        | «      dk7  r
t        «       ‚t        j	                  | «      s
t        «       ‚| | ddd…   k(  r
t        «       ‚t        j                  | «       | S )úoCheck if the number provided is a valid Aadhaar number. This checks
    the length, formatting and check digit.é   Néÿÿÿÿ)r   ÚlenÚInvalidLengthÚ
aadhaar_reÚmatchÚInvalidFormatr   Úvalidater	   s    r   r   r   P   sb   € ô �V‹_€FÜ
ˆ6ƒ{�bÒÜ‹oÐÜ×Ñ˜FÔ#Ü‹oÐØ�™˜"˜‘ÒÜ‹oÐÜ×Ñ�fÔØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)r   F)Úboolr   ÚValidationErrorr	   s    r   Úis_validr   ^   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   Újoinr	   s    r   Úformatr!   g   s3   € ä�V‹_€FØ�8‰8�V˜B˜Q�Z ¨¨! ¨f°Q°R¨jÐ9Ó:Ð:r   c                ó(   — t        | «      } d| dd z   S )zjMasks the first 8 digits as per Ministry of Electronics and
    Information Technology (MeitY) guidelines.z
XXXX XXXX éüÿÿÿN)r   r	   s    r   Úmaskr$   m   s   € ô �V‹_€FØ˜&  ˜+Ñ%Ð%r   )r
   ÚstrÚreturnr%   )r
   r%   r&   r   )Ú__doc__Ú
__future__r   ÚreÚstdnumr   Ústdnum.exceptionsÚstdnum.utilr   Úcompiler   r   r   r   r!   r$   © r   r   ú<module>r/      sK   ðñ*&õP #ã 	å Ü Ý ð ˆR�Z‰ZÐ+Ó,€
Ø Aó'óóó;ô&r   