Ë
    òT•jI  ã            
       óò  — d Z ddlZ	 ddlZddlZddlZ	ddl
Z
ddlmZ ddlmZ  e
j"                  ed¬	«       e	j&                  e	j(                  z   d
z   Z e«       Z G d„ d edd«      «      Zd%ddœd„Zd%d„Zg Zddœd„Z edddd«        edddd«       dD ]  Z eddez   dd ee«      z   d¬«      sŒ n  eddd d!«        ed"dd#d$«       [[y# e$ r  ej
                  dk(  r ed«      ‚ ed«      ‚w xY w)&zEWrapper to the POSIX crypt library call and associated functionality.é    NÚwin32z,The crypt module is not supported on Windowsz;The required _crypt module was not built as part of CPython)ÚSystemRandom)Ú
namedtuple)é   é   )Úremovez./c                   ó   — e Zd ZdZd„ Zy)Ú_MethodziClass representing a salt method per the Modular Crypt Format or the
    legacy 2-character crypt method.c                 ó8   — dj                  | j                  «      S )Nz<crypt.METHOD_{}>)ÚformatÚname)Úselfs    ú/usr/lib/python3.12/crypt.pyÚ__repr__z_Method.__repr__    s   € Ø"×)Ñ)¨$¯)©)Ó4Ð4ó    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   © r   r   r
   r
      s   „ ñ(ó5r   r
   z name ident salt_chars total_size©Úroundsc                óª  — | €	t         d   } |�2t        |t        «      s"t        |j                  j
                  › d�«      ‚| j                  sd}nd| j                  › d�}| j                  rn| j                  d   dk(  r\|€d}nMt        j                  |dz
  «      }|d|z  k7  rt        d«      ‚d	|cxk  rd
k  st        d«      ‚ t        d«      ‚||d›d�z  }nL| j                  dv r.|�<d|cxk  rdk  st        d«      ‚ t        d«      ‚|d|› d�z  }n|�t        | › d�«      ‚|dj                  d„ t        | j                  «      D «       «      z  }|S )zsGenerate a salt for the specified method.

    If not specified, the strongest available method will be used.

    r   z+ object cannot be interpreted as an integerÚ ú$Ú2é   é   zrounds must be a power of 2é   é   z%rounds out of the range 2**4 to 2**31Ú02d)Ú5Ú6iè  iÿÉš;z+rounds out of the range 1000 to 999_999_999zrounds=z$ doesn't support the rounds argumentc              3   óN   K  — | ]  }t         j                  t        «      –— Œ y ­w©N)Ú_srÚchoiceÚ
_saltchars)Ú.0Úchars     r   ú	<genexpr>zmksalt.<locals>.<genexpr>F   s   è ø€ ÒM¨D”—‘œJ×'ÑMùs   ‚#%)ÚmethodsÚ
isinstanceÚintÚ	TypeErrorÚ	__class__r   ÚidentÚ
bit_lengthÚ
ValueErrorÚjoinÚrangeÚ
salt_chars)Úmethodr   ÚsÚ
log_roundss       r   Úmksaltr:   $   s€  € ð €~Ü˜‘ˆØÐ¤*¨V´SÔ"9Ü˜6×+Ñ+×4Ñ4Ð5ð 64ð 5ó 6ð 	6à�<Š<Ø‰à�—‘ˆ~˜QÐˆà‡|‚|˜Ÿ™ Q™¨3Ò.Øˆ>Ø‰JäŸ™¨¨q©Ó1ˆJØ˜˜j™Ò(Ü Ð!>Ó?Ð?Ø˜
Ô( bÒ(Ü Ð!HÓIÐIð )Ü Ð!HÓIÐIØ	�
˜3Ð˜qÐ!Ñ!‰Ø	�‰˜Ñ	#ØÐØ˜6Ô0 [Ò0Ü Ð!NÓOÐOð 1Ü Ð!NÓOÐOØ�7˜6˜( !Ð$Ñ$‰AØ	Ð	Ü˜F˜8Ð#GÐHÓIÐIàˆ�‰ÑM´E¸&×:KÑ:KÓ4LÔMÓ	MÑM€AØ€Hr   c                 óh   — |�t        |t        «      rt        |«      }t        j                  | |«      S )aR  Return a string representing the one-way hash of a password, with a salt
    prepended.

    If ``salt`` is not specified or is ``None``, the strongest
    available method will be selected and a salt generated.  Otherwise,
    ``salt`` may be one of the ``crypt.METHOD_*`` values, or a string as
    returned by ``crypt.mksalt()``.

    )r-   r
   r:   Ú_cryptÚcrypt)ÚwordÚsalts     r   r=   r=   J   s,   € ð €|”z $¬Ô0Ü�d‹|ˆÜ�<‰<˜˜dÓ#Ð#r   c                óx  — t        | g|¢­Ž }|t        «       d| z   <   t        ||¬«      }d }	 t        d|«      }|r.t        |«      |j                  k(  rt        j                  |«       yy# t        $ rF}|j
                  t
        j                  t
        j                  t
        j                  hv rY d }~y‚ d }~ww xY w)NÚMETHOD_r   r   FT)r
   Úglobalsr:   r=   ÚOSErrorÚerrnoÚEINVALÚEPERMÚENOSYSÚlenÚ
total_sizer,   Úappend)r   r   Úargsr7   r?   ÚresultÚes          r   Ú_add_methodrN   \   s¢   € Ü�TÐ!˜DÒ!€FØ"(„GƒIˆi˜$ÑÑÜ�& Ô(€DØ€FðÜ�r˜4“ˆñ ”#�f“+ ×!2Ñ!2Ò2Ü�‰�vÔØØøô ò à�7‰7”u—|‘|¤U§[¡[´%·,±,Ð?Ñ?ÜØûð	ús   ­A* Á*	B9Á3;B4Â3B4Â4B9ÚSHA512r#   é   éj   ÚSHA256r"   é?   )ÚbÚyÚar   ÚBLOWFISHr   é   é;   ÚMD5Ú1é   é"   ÚCRYPTé   r   r%   )r   ÚsysÚ_sysr<   ÚModuleNotFoundErrorÚplatformÚImportErrorrD   ÚstringÚ_stringÚwarningsÚrandomr   Ú_SystemRandomÚcollectionsr   Ú_namedtupleÚ_deprecatedr   Úascii_lettersÚdigitsr(   r&   r
   r:   r=   r,   rN   Ú_vrH   r   r   r   ú<module>rp      s9  ðÙ Kã ðYÛó Û Û Ý 0Ý 1ð €× Ñ �X gÕ .ð ×"Ñ" W§^¡^Ñ3°dÑ:€
Ùƒo€ô5‰k˜)Ð%GÓHô 5ð# $ô #óL$ð  €à$(ô ñ" ˆH�c˜2˜sÔ #Ù ˆH�c˜2˜rÔ "ð ò €BÙ�:˜s R™x¨¨R±#°b³'©\À$ÖGÙðñ ˆE�3˜˜2Ô Ù ˆG�T˜1˜bÔ !à‰øðk ò YØ‡}�}˜ÒÙÐHÓIÐIáÐWÓXÐXð	Yús   ˆC Ã%C6