ž ¦ÿfWc@s]dZddlZddlZddlmZddlmZ ej ej dZ eƒZ Gdd„de ddƒƒZdd d „Zdd d „Zed dddƒZeddddƒZeddddƒZeddddƒZgZxQeeefD]@ZedeƒZereeƒejkrejeƒqqWejeƒ[[dS(uEWrapper to the POSIX crypt library call and associated functionality.iN(u SystemRandom(u namedtupleu./cBs&|EeZdZdZdd„ZdS(u_MethoduiClass representing a salt method per the Modular Crypt Format or the legacy 2-character crypt method.cCsdj|jƒS(Nu(uformatuname(uself((u*/opt/alt/python33/lib64/python3.3/crypt.pyu__repr__su_Method.__repr__N(u__name__u __module__u __qualname__u__doc__u__repr__(u __locals__((u*/opt/alt/python33/lib64/python3.3/crypt.pyu_Method su_Methodu name ident salt_chars total_sizecCsg|dkrtd}n|jr4dj|jƒnd}|djdd„t|jƒDƒƒ7}|S(usGenerate a salt for the specified method. If not specified, the strongest available method will be used. iu${}$ucss|]}tjtƒVqdS(N(u_sruchoiceu _saltchars(u.0uchar((u*/opt/alt/python33/lib64/python3.3/crypt.pyu sumksalt..N(uNoneumethodsuidentuformatujoinurangeu salt_chars(umethodus((u*/opt/alt/python33/lib64/python3.3/crypt.pyumksalts   !)umksaltcCs:|dkst|tƒr*t|ƒ}ntj||ƒS(uRReturn 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(uNoneu isinstanceu_Methodumksaltu_cryptucrypt(uwordusalt((u*/opt/alt/python33/lib64/python3.3/crypt.pyucrypt#s ucryptuCRYPTii uMD5u1ii"uSHA256u5ii?uSHA512u6iju(u__doc__u_cryptustringu_stringurandomu SystemRandomu _SystemRandomu collectionsu namedtupleu _namedtupleu ascii_lettersudigitsu _saltcharsu_sru_MethoduNoneumksaltucryptu METHOD_CRYPTu METHOD_MD5u METHOD_SHA256u METHOD_SHA512umethodsu_methodu_resultulenu total_sizeuappend(((u*/opt/alt/python33/lib64/python3.3/crypt.pyus(