python (3.11.7)
eI
d Z ddlZ ddlZn*# e$ r" ej dk r ed ed w xY wddlZddlZ ddl
Z
ddlmZ
ddlmZ e
j ed e j e j z d
z Z e
Z G d d edd
Zd%dddZd%dZg ZdddZ edddd edddd dD ]#Z eddez dd ee z d r n$ eddd d! ed"dd#d$ [[dS )&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./c e Zd ZdZd ZdS )_MethodziClass representing a salt method per the Modular Crypt Format or the
legacy 2-character crypt method.c 6 d | j S )Nz<crypt.METHOD_{}>)formatname)selfs 9/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/crypt.py__repr__z_Method.__repr__ s "))$)444 N)__name__
__module____qualname____doc__r r r r
r
s- ( (5 5 5 5 5r r
z name ident salt_chars total_sizeroundsc |
t d } |1t |t st |j j d | j sd}nd| j d}| j rs| j d dk rb|d}nSt |dz
}|d|z k rt d d
|cxk rdk sn t d ||d
dz
}nG| j dv r*|'d|cxk rdk sn t d |d| dz
}n|t | d |d d t | j D z
}|S )zsGenerate a salt for the specified method.
If not specified, the strongest available method will be used.
Nr z+ 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**3102d)56i iɚ;z+rounds out of the range 1000 to 999_999_999zrounds=z$ doesn't support the rounds argumentc 3 T K | ]#}t t V $d S N)_srchoice
_saltchars).0chars r <genexpr>zmksalt.<locals>.<genexpr>F s. MMDJ''MMMMMMr )methods
isinstanceint TypeError __class__r ident
bit_length
ValueErrorjoinrange
salt_chars)methodr s
log_roundss r mksaltr: $ s ~
*VS"9"96+4 5 5 5 6 6 6<