
    =OgI              
          	 d dl Z	 d dlZn*# e$ r" ej        dk    r ed           ed          w xY w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          r n$ edddd             ed!dd"d#           [[dS )%    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S )_Methodc                 6    d                     | j                  S )Nz<crypt.METHOD_{}>)formatname)selfs    /usr/lib64/python3.11/crypt.py__repr__z_Method.__repr__    s    "))$)444    N)__name__
__module____qualname__r    r   r   r
   r
      s(        (5 5 5 5 5r   r
   z name ident salt_chars total_sizeroundsc                   	 | t           d         } |1t          |t                    st          |j        j         d          | j        sd}nd| j         d}| j        rs| j        d         dk    rb|d}nSt                              |dz
            }|d|z  k    rt          d          d	|cxk    rd
k    sn t          d          ||ddz  }nG| j        dv r*|'d|cxk    rdk    sn t          d          |d| dz  }n|t          |  d          |d	                    d t          | j                  D                       z  }|S )Nr   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   T   K   | ]#}t                               t                    V  $d S N)_srchoice
_saltchars).0chars     r   	<genexpr>zmksalt.<locals>.<genexpr>F   s.      MMDJ''MMMMMMr   )methods
isinstanceint	TypeError	__class__r   ident
bit_length
ValueErrorjoinrange
salt_chars)methodr   s
log_roundss       r   mksaltr9   $   s   
 ~*VS"9"96+4 5 5 5 6 6 	6<  | JQ3..>JJq11Jj(( !>???
((((b(((( !HIII	
!!!!!		#	#60000[0000 !NOOO$6$$$$A		FHHHIIIMME&:K4L4LMMM	M	MMAHr   c                 z    	 |t          |t                    rt          |          }t          j        | |          S r$   )r,   r
   r9   _cryptcrypt)wordsalts     r   r<   r<   J   s9     |z$00|d||<d###r   c                   t          | g|R  }|t                      d| z   <   t          ||          }d }	 t          d|          }nC# t          $ r6}|j        t
          j        t
          j        t
          j        hv rY d }~dS  d }~ww xY w|r4t          |          |j
        k    rt                              |           dS dS )NMETHOD_r   r   FT)r
   globalsr9   r<   OSErrorerrnoEINVALEPERMENOSYSlen
total_sizer+   append)r   r   argsr6   r>   resultes          r   _add_methodrM   \   s    T!D!!!F"(GIIi$&(((DFr4   7u|U[%,???55555	
  #f++!222vt5s   A 
B*BBBSHA512r"      j   SHA256r!   ?   )byar   BLOWFISHr      ;   MD51   "   CRYPT   r   r$   )sys_sysr;   ModuleNotFoundErrorplatformImportErrorrC   string_stringwarningsrandomr   _SystemRandomcollectionsr   _namedtuple_deprecatedr   ascii_lettersdigitsr'   r%   r
   r9   r<   r+   rM   _vrG   r   r   r   <module>ro      s.   K    YMMMM Y Y Y}kHIIIkWXXX	Y       0 0 0 0 0 0 1 1 1 1 1 1  Xg . . . . "W^3d:
moo5 5 5 5 5kk)%GHH 5 5 5#$ # # # # #L$ $ $ $  $(     " Hc2s # # # Hc2r " " "   B{:sRxR##b''\$GGG  E32    GT1b ! ! !s    '3