QfI dZddlZ ddlZddlZddlZ ddl Z ddl m Z ddlmZe j"ed e j&e j(zd zZe ZGd d ed d Zd%dddZd%dZgZdddZeddddedddddD]Zeddezddeezdsneddd d!ed"dd#d$[[y#e$r ej dk(rededwxYw)&zEWrapper to the POSIX crypt library call and associated functionality.Nwin32z,The crypt module is not supported on Windowsz;The required _crypt module was not built as part of CPython) SystemRandom) namedtuple) )removez./ceZdZdZdZy)_MethodziClass representing a salt method per the Modular Crypt Format or the legacy 2-character crypt method.c8dj|jS)Nz)formatname)selfs ,/opt/alt/python312/lib64/python3.12/crypt.py__repr__z_Method.__repr__ s"))$))44N)__name__ __module__ __qualname____doc__rrrr r s (5rr z name ident salt_chars total_sizeroundsc| td}|2t|ts"t|jj d|j sd}nd|j d}|j rn|j ddk(r\|d}nMtj|dz }|d|zk7r tdd |cxkrd kstd td ||d dz }nL|j d vr.|zmksalt..FsM4LDJ'4Ls#%) methods isinstanceint TypeError __class__rident bit_length ValueErrorjoinrange salt_chars)methodrs log_roundss rmksaltr:$s ~ *VS"96++4456456 6 <<  ~Q  || Q3. >Jq1Jj( !>?? (b( !HII) !HII 3q !!  #  60[0 !NOO1 !NOO 76(!$ $A  F8#GHIIME&:K:K4LM MMA Hrch|t|tr t|}tj||S)aRReturn 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:_cryptcrypt)wordsalts rr=r=Js, |z$0d| <<d ##rcxt|g|}|td|z<t||}d} td|}|r.t||jk(rtj|yy#t$rF}|j t j t jt jhvrYd}~yd}~wwxYw)NMETHOD_rrFT) r globalsr:r=OSErrorerrnoEINVALEPERMENOSYSlen total_sizer,append)r rargsr7r?resultes r _add_methodrN\s T !D !F"(GIi$ & (D Fr4 #f+!2!22v   77u||U[[%,,? ? s A** B93;B43B44B9SHA512r#jSHA256r"?)byarBLOWFISHr;MD51"CRYPTrr%)rsys_sysr<ModuleNotFoundErrorplatform ImportErrorrDstring_stringwarningsrandomr _SystemRandom collectionsr _namedtuple _deprecatedr ascii_lettersdigitsr(r&r r:r=r,rN_vrHrrrrps4KY 01Xg. " "W^^ 3d : o5k)%GH5# $# L $ $(" Hc2s# Hc2r" B:sRxR#b'\$G   E32 GT1b! kY }}HIIWXX Ys C%C6