| Server IP : 104.21.25.182 / Your IP : 216.73.217.22 Web Server : Apache System : Linux server.rehabsharif.com 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64 User : nobi37te ( 1003) PHP Version : 8.2.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3.9/site-packages/passlib/handlers/__pycache__/ |
Upload File : |
a
f�Wc� � @ st d Z ddlmZ ddlZe�e�ZddlmZ ddl m
Z
mZmZ ddl
m mZ dgZG dd� dejej�ZdS )zXpasslib.handlers.postgres_md5 - MD5-based algorithm used by Postgres for pg_shadow table� )�md5N)�to_bytes)�
str_to_uascii�unicode�u�postgres_md5c @ s. e Zd ZdZd Zed�ZejZ dZ
dd� ZdS )r a� 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 � c C s8 t |t�r|�d�}t| jddd�}tt|| ��� �S )Nzutf-8�user)Zparam)�
isinstancer �encoder r r r � hexdigest)�selfZsecretr � r �=/usr/lib/python3.9/site-packages/passlib/handlers/postgres.py�_calc_checksum+ s
zpostgres_md5._calc_checksumN)�__name__�
__module__�__qualname__�__doc__�namer Z_hash_prefix�uhZ HEX_CHARSZchecksum_charsZ
checksum_sizer r r r r r s
)r Zhashlibr ZloggingZ getLoggerr �logZ
passlib.utilsr Zpasslib.utils.compatr r r Zpasslib.utils.handlersZutils�handlersr �__all__ZHasUserContextZ
StaticHandlerr r r r r �<module> s �