File: //proc/3/root/lib64/python2.7/crypt.pyo
�
zfc           @   sW  d  Z  d d l Z d d l Z d d l m Z d d l m Z	 e j
 e j d Z e �  Z
 d e	 d d � f d �  �  YZ d d	 � Z d d
 � Z e d d d d
 � Z e d d d d � Z e d d d d � Z e d d d d � Z g  Z xQ e e e f D]@ Z e d e � Z e r� e e � e j k r� e j e � q� q� We j e � [ [ d S(   s�   Wrapper to the POSIX crypt library call and associated functionality.
Note that the ``methods`` and ``METHOD_*`` attributes are non-standard
extensions to Python 2.7, backported from 3.3i����N(   t   SystemRandom(   t
   namedtuples   ./t   _Methods    name ident salt_chars total_sizec           B   s   e  Z d  Z d �  Z RS(   si   Class representing a salt method per the Modular Crypt Format or the
    legacy 2-character crypt method.c         C   s   d |  j  S(   Ns   <crypt.METHOD_%s>(   t   name(   t   self(    (    s   /usr/lib64/python2.7/crypt.pyt   __repr__   s    (   t   __name__t
   __module__t   __doc__R   (    (    (    s   /usr/lib64/python2.7/crypt.pyR      s   c         C   s[   |  d k r t d }  n  |  j r/ d |  j n d } | d j t j t |  j � � 7} | S(   s�   Generate a salt for the specified method.
    If not specified, the strongest available method will be used.
    This is a non-standard extension to Python 2.7, backported from 3.3
    i    s   $%s$t    N(   t   Nonet   methodst   identt   joint   _srt   samplet
   _saltcharst
   salt_chars(   t   methodt   s(    (    s   /usr/lib64/python2.7/crypt.pyt   mksalt   s
    
"c         C   s:   | d k s t | t � r* t | � } n  t j |  | � S(   sN  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()``.
    Note that these are non-standard extensions to Python 2.7's crypt.crypt()
    entrypoint, backported from 3.3: the standard Python 2.7 crypt.crypt()
    entrypoint requires two strings as the parameters, and does not support
    keyword arguments.
    N(   R
   t
   isinstanceR   R   t   _cryptt   crypt(   t   wordt   salt(    (    s   /usr/lib64/python2.7/crypt.pyR   '