ó
ö
5Xc @ s d Z d d l m Z d d l Z e j e Z d d l m Z d d l m
Z
m Z m Z d d l
j j Z d g Z d e j e j f d YZ d S( sX passlib.handlers.postgres_md5 - MD5-based algorithm used by Postgres for pg_shadow tablei˙˙˙˙( t md5N( t to_bytes( t
str_to_uasciit unicodet ut postgres_md5c B s8 e Z d Z d Z e d Z e j Z d Z 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.
R R i c C sS t | t r! | j d } n t | j d d d } t t | | j S( Ns utf-8t paramt user( t
isinstanceR t encodeR R R R t hexdigest( t selft secretR ( ( s= /usr/lib/python2.7/site-packages/passlib/handlers/postgres.pyt _calc_checksum+ s ( t __name__t
__module__t __doc__t nameR t _hash_prefixt uht HEX_CHARSt checksum_charst
checksum_sizeR
( ( ( s= /usr/lib/python2.7/site-packages/passlib/handlers/postgres.pyR s
( R t hashlibR t loggingt getLoggerR t logt
passlib.utilsR t passlib.utils.compatR R R t passlib.utils.handlerst utilst handlersR t __all__t HasUserContextt
StaticHandlerR ( ( ( s= /usr/lib/python2.7/site-packages/passlib/handlers/postgres.pyt <module> s