U e5d@s,ddlZz ddlZWn0ek rDejdkr8ednedYnXddlZddlm Z ddl m Z ejejdZe ZGdd d e d d Zd%dd d d Zd&ddZgZdd ddZeddddedddddD](Zeddeddeedd rqqeddd 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@seZdZddZdS)_MethodcCs d|jS)Nz)formatname)selfr/usr/lib64/python3.8/crypt.py__repr__sz_Method.__repr__N)__name__ __module__ __qualname__r rrrr rsrz name ident salt_chars total_sizeroundscCsB|dkrtd}|dk r4t|ts4t|jjd|js@d}nd|jd}|jr|jddkr|dkrpd}n@t|d}|d|>krtdd |krd ksntd ||d d7}n^|jd kr|dk r d|krdksntd|d|d7}n|dk r t|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 Aszmksalt..) methods isinstanceint TypeError __class__r Zident bit_length ValueErrorjoinrangeZ salt_chars)methodrsZ log_roundsrrr mksalts2    r*cCs&|dkst|trt|}t||Sr)r rr*_cryptcrypt)Zwordsaltrrr r,Es r,cGsVt|f|}|td|<t||d}td|}|rRt||jkrRt|dSdS)NZMETHOD_rrTF)rglobalsr*r,lenZ total_sizerappend)rrargsr(r-resultrrr _add_methodWs   r3ZSHA512rjZSHA256r?)byarZBLOWFISHr;ZMD51"ZCRYPT )N)N)sys_sysr+ModuleNotFoundErrorplatform ImportErrorstringZ_stringZrandomrZ _SystemRandom collectionsrZ _namedtupleZ ascii_lettersZdigitsrrrr*r,rr3Z_vr/rrrr s0      &