U e5dã@s,ddlZz ddlZWn0ek rDejdkr8edƒ‚nedƒ‚YnXddlZddlm Z ddl m Z ejejdZe ƒZGdd „d e d d ƒƒZd%dd œd d „Zd&dd„ZgZdd œdd„ZeddddƒeddddƒdD](Zeddeddeeƒdd �rÞ�qqÞeddd d!ƒed"dd#d$ƒ[[dS)'éNZwin32z,The crypt module is not supported on Windowsz;The required _crypt module was not built as part of CPython)Ú SystemRandom)Ú namedtuplez./c@seZdZdd„ZdS)Ú_MethodcCs d |j¡S)Nz)ÚformatÚname)Úself©rú/usr/lib64/python3.8/crypt.pyÚ__repr__sz_Method.__repr__N)Ú__name__Ú __module__Ú __qualname__r rrrr rsrz name ident salt_chars total_size©ÚroundscCsB|dkrtd}|dk r4t|tƒs4t|jj›d�ƒ‚|js@d}nd|j›d�}|jrÂ|jddkrÂ|dkrpd}n@t |d¡}|d|>kr’tdƒ‚d |kr¦d ks°ntd ƒ‚||d ›d�7}n^|jd k�r|dk �r d|krìdksöntdƒ‚|d|›d�7}n|dk �r t|›d�ƒ‚|d  dd„t |j ƒDƒ¡7}|S)Nrz+ object cannot be interpreted as an integerÚú$Ú2é ézrounds must be a power of 2ééz%rounds out of the range 2**4 to 2**31Z02d)Ú5Ú6ièiÿÉš;z+rounds out of the range 1000 to 999_999_999zrounds=z$ doesn't support the rounds argumentcss|]}t t¡VqdS©N)Ú_srZchoiceÚ _saltchars)Ú.0Úcharrrr Ú Aszmksalt..) ÚmethodsÚ isinstanceÚintÚ TypeErrorÚ __class__r ZidentÚ bit_lengthÚ ValueErrorÚjoinÚrangeZ salt_chars)ÚmethodrÚsZ log_roundsrrr Úmksalts2    r*cCs&|dkst|tƒrt|ƒ}t ||¡Sr)r rr*Ú_cryptÚcrypt)ZwordÚsaltrrr r,Es r,cGsVt|f|žŽ}|tƒd|<t||d�}td|ƒ}|rRt|ƒ|jkrRt |¡dSdS)NZMETHOD_rrTF)rÚglobalsr*r,ÚlenZ total_sizerÚappend)rrÚargsr(r-Úresultrrr Ú _add_methodWs   r3ZSHA512rééjZSHA256ré?)ÚbÚyÚarZBLOWFISHréé;ZMD5Ú1éé"ZCRYPTéé )N)N)ÚsysÚ_sysr+ÚModuleNotFoundErrorÚplatformÚ ImportErrorÚstringZ_stringZrandomrZ _SystemRandomÚ collectionsrZ _namedtupleZ ascii_lettersZdigitsrrrr*r,rr3Z_vr/rrrr Ús0      &