HEX
Server: nginx/1.24.0
System: Linux localhost 5.15.0-46-generic #49-Ubuntu SMP Thu Aug 4 18:03:25 UTC 2022 x86_64
User: www (1000)
PHP: 8.3.27
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: //proc/93580/root/usr/lib/python3.10/__pycache__/crypt.cpython-310.pyc
o

p̦i�@s.dZddlZzddlZWney ejdkred��ed��wddlZddlZ	ddl
mZddl
mZe	je	jdZe�ZGd	d
�d
ed
d��Zd&dd�d
d�Zd&dd�ZgZdd�dd�Zedddd�edddd�dD]Zeddeddee�dd�r�nqqedd d!d"�ed#dd$d%�[[dS)'zEWrapper to the POSIX crypt library call and associated functionality.�N�win32z,The crypt module is not supported on Windowsz;The required _crypt module was not built as part of CPython)�SystemRandom)�
namedtuplez./c@seZdZdZdd�ZdS)�_MethodziClass representing a salt method per the Modular Crypt Format or the
    legacy 2-character crypt method.cCsd�|j�S)Nz<crypt.METHOD_{}>)�format�name)�self�r	�/usr/lib/python3.10/crypt.py�__repr__sz_Method.__repr__N)�__name__�
__module__�__qualname__�__doc__rr	r	r	r
rsrz name ident salt_chars total_size��roundscCsH|durtd}|durt|t�st|jj�d���|js d}nd|j�d�}|jrd|jddkrd|dur8d}n#t�|d�}|d|>krItd	��d
|krVdks[td��td��||d
�d�7}n/|jdvr�|dur�d|krzdkstd��td��|d|�d�7}n|dur�t|�d���|d�	dd�t
|j�D��7}|S)zsGenerate a salt for the specified method.

    If not specified, the strongest available method will be used.

    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**31�02d)�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)�_sr�choice�
_saltchars)�.0�charr	r	r
�	<genexpr>Bs�zmksalt.<locals>.<genexpr>)�methods�
isinstance�int�	TypeError�	__class__r�ident�
bit_length�
ValueError�join�range�
salt_chars)�methodr�s�
log_roundsr	r	r
�mksalt s<�
��r1cCs&|dus	t|t�r
t|�}t�||�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()``.

    N)r$rr1�_crypt�crypt)�word�saltr	r	r
r3Fs
r3c
Gs�t|g|�R�}|t�d|<t||d�}d}ztd|�}Wnty=}z|jtjtjtjhvr8WYd}~dS�d}~ww|rNt	|�|j
krNt�|�dSdS)N�METHOD_rrFT)
r�globalsr1r3�OSError�errno�EINVAL�EPERM�ENOSYS�len�
total_sizer#�append)rr�argsr.r5�result�er	r	r
�_add_methodXs ��
rC�SHA512r��j�SHA256r�?)�b�y�ar�BLOWFISHr��;�MD5�1��"�CRYPT��
r)r�sys�_sysr2�ModuleNotFoundError�platform�ImportErrorr9�string�_string�randomr�
_SystemRandom�collectionsr�_namedtuple�
ascii_letters�digitsrrrr1r3r#rC�_vr=r	r	r	r
�<module>s:
�	
&�