Current File : //usr/lib/python2.7/site-packages/passlib/handlers/postgres.pyo
�
�
5Xc@s�dZddlmZddlZeje�ZddlmZddl	m
Z
mZmZddl
jjZdgZdejejfd��YZdS(sXpasslib.handlers.postgres_md5 - MD5-based algorithm used by Postgres for pg_shadow tablei����(tmd5N(tto_bytes(t
str_to_uasciitunicodetutpostgres_md5cBs8eZdZdZed�ZejZdZ	d�Z
RS(s�This class implements the Postgres MD5 Password hash, and follows the :ref:`password-hash-api`.

    It does a single round of hashing, and relies on the username as the salt.

    The :meth:`~passlib.ifc.PasswordHash.hash`, :meth:`~passlib.ifc.PasswordHash.genhash`, and :meth:`~passlib.ifc.PasswordHash.verify` methods all require the
    following additional contextual keywords:

    :type user: str
    :param user: name of postgres user account this password is associated with.
    RRi cCsSt|t�r!|jd�}nt|jddd�}tt||�j��S(Nsutf-8tparamtuser(t
isinstanceRtencodeRRRRt	hexdigest(tselftsecretR((s=/usr/lib/python2.7/site-packages/passlib/handlers/postgres.pyt_calc_checksum+s(t__name__t
__module__t__doc__tnameRt_hash_prefixtuht	HEX_CHARStchecksum_charst
checksum_sizeR
(((s=/usr/lib/python2.7/site-packages/passlib/handlers/postgres.pyRs
	(RthashlibRtloggingt	getLoggerRtlogt
passlib.utilsRtpasslib.utils.compatRRRtpasslib.utils.handlerstutilsthandlersRt__all__tHasUserContextt
StaticHandlerR(((s=/usr/lib/python2.7/site-packages/passlib/handlers/postgres.pyt<module>s