MINI MINI MANI MO
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&