https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/django/contrib/auth/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/django/contrib/auth/__pycache__/tokens.cpython-310.pyc
o

3�a��@sTddlmZmZddlmZddlmZmZddlmZm	Z	Gdd�d�Z
e
�ZdS)�)�datetime�time)�settings)�constant_time_compare�salted_hmac)�
base36_to_int�
int_to_base36c@sVeZdZdZdZdZdZdd�Zdd�Zdd	�Z	ddd�Z
d
d�Zdd�Zdd�Z
dS)�PasswordResetTokenGeneratorza
    Strategy object used to generate and check tokens for the password
    reset mechanism.
    z6django.contrib.auth.tokens.PasswordResetTokenGeneratorNcCs |jptj|_|jptj|_dS�N)�secretr�
SECRET_KEY�	algorithm�DEFAULT_HASHING_ALGORITHM��self�r�</usr/lib/python3/dist-packages/django/contrib/auth/tokens.py�__init__sz$PasswordResetTokenGenerator.__init__cCs|�||�|����S)zi
        Return a token that can be used once to do a password reset
        for the given user.
        )�_make_token_with_timestamp�_num_seconds�_now)r�userrrr�
make_tokensz&PasswordResetTokenGenerator.make_tokencCs�|r|sdSz|�d�\}}t|�dk}Wn
tyYdSwzt|�}Wn
ty0YdSwt|�||�|�sGt|j||dd�|�sGdS|��}|rb|d9}|t|t�	|�
�tj��
��7}|�|�|tjkrndSdS)zP
        Check that a password reset token is correct for a given user.
        F�-�T)�legacyi�Q)�split�len�
ValueErrorrrrr�intr�combine�dater�min�
total_secondsrr�PASSWORD_RESET_TIMEOUT)rr�token�ts_b36�_�legacy_token�ts�nowrrr�check_tokens4���"z'PasswordResetTokenGenerator.check_tokenFcCsHt|�}t|j|�||�|j|rdn|jd���ddd�}d||fS)N�sha1)rr
�z%s-%s)rr�key_salt�_make_hash_valuerr
�	hexdigest)rr�	timestamprr&�hash_stringrrrrHs
��	z6PasswordResetTokenGenerator._make_token_with_timestampcCsR|jdurdn|jjddd�}|��}t||d�pd}|j�|j�|�|�|��S)a�
        Hash the user's primary key, email (if available), and some user state
        that's sure to change after a password reset to produce a token that is
        invalidated when it's used:
        1. The password field will change upon a password reset (even if the
           same password is chosen, due to password salting).
        2. The last_login field will usually be updated very shortly after
           a password reset.
        Failing those things, settings.PASSWORD_RESET_TIMEOUT eventually
        invalidates the token.

        Running this data through salted_hmac() prevents password cracking
        attempts using the reset token, provided the secret isn't compromised.
        N�r)�microsecond�tzinfo)�
last_login�replace�get_email_field_name�getattr�pk�password)rrr1�login_timestamp�email_field�emailrrrr/Wsz,PasswordResetTokenGenerator._make_hash_valuecCst|tddd����S)Ni��)rrr#)r�dtrrrrmsz(PasswordResetTokenGenerator._num_secondscCst��Sr
)rr*rrrrrpsz PasswordResetTokenGenerator._now)F)�__name__�
__module__�__qualname__�__doc__r.r
rrrr+rr/rrrrrrr	s
*r	N)rr�django.confr�django.utils.cryptorr�django.utils.httprrr	�default_token_generatorrrrr�<module>s
m

https://t.me/RX1948 - 2025