Edit File: crypt.cpython-36.pyc
3 � \H������������������@���s����d�Z�ddlZddlZddlmZ�ddlmZ �ej ej�d�Ze��Z G�dd��de dd��Zdd d �Zddd�Zed ddd�Zedddd�Zedddd�Zedddd�Zg�Zx:eeeefD�]*Zede�Zer�ee�ejkr�eje��q�W�[[dS�)zEWrapper to the POSIX crypt library call and associated functionality.�����N)�SystemRandom)� namedtuplez./c���������������@���s���e�Zd�ZdZdd��ZdS�)�_MethodziClass representing a salt method per the Modular Crypt Format or the legacy 2-character crypt method.c�������������C���s���dj�|�j�S�)Nz<crypt.METHOD_{}>)�format�name)�self��r����/usr/lib64/python3.6/crypt.py�__repr__���s����z_Method.__repr__N)�__name__� __module__�__qualname__�__doc__r ���r���r���r���r ���r��� ���s���r���z name ident salt_chars total_sizec�������������C���sH���|�dkrt�d�}�|�jr"dj|�j�nd}|djdd��t|�j�D���7�}|S�)zsGenerate a salt for the specified method. If not specified, the strongest available method will be used. Nr���z${}$��c�������������s���s���|�]}t�jt�V��qd�S�)N)�_srZchoice� _saltchars)�.0�charr���r���r ���� <genexpr>���s����zmksalt.<locals>.<genexpr>)�methodsZidentr����join�rangeZ salt_chars)�method�sr���r���r ����mksalt���s ����r���c�������������C���s&���|dkst�|t�rt|�}tj|�|�S�)aR��Return 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)� isinstancer���r����_crypt�crypt)ZwordZsaltr���r���r ���r���#���s���� r���ZCRYPT����� ���ZMD5�1�����"���ZSHA256�5�����?���ZSHA512�6�j���r���)N)N)r���r����stringZ_stringZrandomr���Z _SystemRandom�collectionsr���Z_namedtupleZ ascii_lettersZdigitsr���r���r���r���r���ZMETHOD_CRYPTZ METHOD_MD5Z METHOD_SHA256Z METHOD_SHA512r����_methodZ_result�lenZ total_size�appendr���r���r���r ����<module>���s&���