Ë
    Ã?ÆiX  ã                  óŒ   — 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×  VID (Indian personal virtual identity number).

VID is a temporary, revocable 16-digit random number mapped with the Aadhaar number.
VID is used in lieu of Aadhaar number whenever authentication or e-KYC services
are performed.

VID is made up of 16 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://uidai.gov.in/en/contact-support/have-any-question/284-faqs/aadhaar-online-services/virtual-id-vid.html
* https://uidai.gov.in/images/resource/UIDAI_Circular_11012018.pdf

>>> validate('2341234123412341')
'2341234123412341'
>>> validate('2341234123412342')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('1341234123412341')  # number should not start with 0 or 1
Traceback (most recent call last):
    ...
InvalidFormat: ...
>>> validate('13412341234123')
Traceback (most recent call last):
    ...
InvalidLength: ...
>>> validate('2222222222222222')  # number cannot be a palindrome
Traceback (most recent call last):
    ...
InvalidFormat: ...
>>> format('2341234123412342')
'2341 2341 2341 2342'
>>> mask('2341234123412342')
'XXXX XXXX  XXXX 2342'
é    )ÚannotationsN)Úverhoeff)Ú*)Úcleanz^[2-9][0-9]{15}$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    úU/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/in_/vid.pyÚcompactr   H   s   € ô �˜Ó×$Ñ$Ó&Ð&ó    c                óÞ   — t        | «      } t        | «      dk7  r
t        «       ‚t        j	                  | «      s
t        «       ‚| | ddd…   k(  r
t        «       ‚t        j                  | «       | S )úkCheck if the number provided is a valid VID number. This checks
    the length, formatting and check digit.é   Néÿÿÿÿ)r   ÚlenÚInvalidLengthÚ_vid_reÚmatchÚInvalidFormatr   Úvalidater	   s    r   r   r   N   s`   € ô �V‹_€FÜ
ˆ6ƒ{�bÒÜ‹oÐÜ�=‰=˜Ô Ü‹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                óZ   — t        | «      } dj                  | dd | dd | dd | dd f«      S )z8Reformat the number to the standard presentation format.ú Né   é   é   )r   Újoinr	   s    r   Úformatr"   e   s;   € ä�V‹_€FØ�8‰8�V˜B˜Q�Z ¨¨! ¨f°Q°r¨l¸FÀ2À3¸KÐHÓIÐIr   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 XXXX éüÿÿÿN)r   r	   s    r   Úmaskr%   k   s   € ô �V‹_€FØ˜v b c˜{Ñ*Ð*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>r0      sL   ðñ(%õN #ã 	å Ü Ý ð ˆ"�*‰*Ð(Ó
)€Ø =ó'óóóJô+r   