o ?Og@s, ddlZzddlZWneyejdkrededwddlZddlZddl m Z ddl m ZejejdZe ZGdd d ed d Zd%dd d d Zd%ddZgZdd ddZeddddedddddD]Zeddeddeedd rnqpeddd 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@seZdZ ddZdS)_MethodcCs d|jS)Nz)formatname)selfr,/opt/alt/python310/lib64/python3.10/crypt.py__repr__s z_Method.__repr__N)__name__ __module__ __qualname__r rrrr rs rz name ident salt_chars total_sizeroundscCsJ |dur td}|durt|tst|jjd|js!d}nd|jd}|jre|jddkre|dur9d}n#t|d}|d|>krJtdd |krWd ks\td td ||d d7}n/|jd vr|durd|kr{dkstdtd|d|d7}n |durt|d|d ddt |j D7}|S)Nrz+ object cannot be interpreted as an integer$2 zrounds must be a power of 2z%rounds out of the range 2**4 to 2**31Z02d)56iiɚ;z+rounds out of the range 1000 to 999_999_999zrounds=z$ doesn't support the rounds argumentcss|]}ttVqdSN)_srZchoice _saltchars).0charrrr Bszmksalt..) methods isinstanceint TypeError __class__r Zident bit_length ValueErrorjoinrangeZ salt_chars)methodrsZ log_roundsrrr mksalt s>  r*cCs( |dus t|trt|}t||Sr)r rr*_cryptcrypt)Zwordsaltrrr r,Fs  r,c Gst|g|R}|td|<t||d}d}ztd|}Wnty=}z|jtjtjtjhvr8WYd}~dSd}~ww|rNt ||j krNt |dSdS)NZMETHOD_rrFT) rglobalsr*r,OSErrorerrnoZEINVALZEPERMZENOSYSlenZ total_sizerappend)rrargsr(r-resulterrr _add_methodXs   r6ZSHA512rjZSHA256r?)byarZBLOWFISHr;ZMD51"ZCRYPT r)sys_sysr+ModuleNotFoundErrorplatform ImportErrorr0stringZ_stringZrandomrZ _SystemRandom collectionsrZ _namedtupleZ ascii_lettersZdigitsrrrr*r,rr6Z_vr1rrrr s:      &