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/utils/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/django/utils/__pycache__/crypto.cpython-310.pyc
o

3�aC�@s�dZddlZddlZddlZddlZddlmZddlmZddl	m
Z
Gdd�de�Zddd	�d
d�Z
e�ZdZeefd
d�Zdd�Zddd�ZdS)z3
Django's standard crypto functions and utilities.
�N)�settings)�RemovedInDjango40Warning)�force_bytesc@seZdZdZdS)�InvalidAlgorithmz&Algorithm is not supported by hashlib.N)�__name__�
__module__�__qualname__�__doc__�r
r
�5/usr/lib/python3/dist-packages/django/utils/crypto.pyrsr�sha1)�	algorithmc
Csx|durtj}t|�}t|�}ztt|�}Wnty)}ztd|�|�d}~ww|||���}tj	|t|�|d�S)a*
    Return the HMAC of 'value', using a key generated from key_salt and a
    secret (which defaults to settings.SECRET_KEY). Default algorithm is SHA1,
    but any algorithm name supported by hashlib can be passed.

    A different key_salt should be passed in for every application of HMAC.
    Nz6%r is not an algorithm accepted by the hashlib module.)�msg�	digestmod)
r�
SECRET_KEYr�getattr�hashlib�AttributeErrorr�digest�hmac�new)�key_salt�value�secretr
�hasher�e�keyr
r
r�salted_hmacs$�����r�>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789cs4|turt�dt�d}d��fdd�t|�D��S)aG
    Return a securely generated random string.

    The bit length of the returned value can be calculated with the formula:
        log_2(len(allowed_chars)^length)

    For example, with default `allowed_chars` (26+26+10), this gives:
      * length: 12, bit length =~ 71 bits
      * length: 22, bit length =~ 131 bits
    z.Not providing a length argument is deprecated.��c3s�|]}t���VqdS�N)�secrets�choice)�.0�i��
allowed_charsr
r�	<genexpr>Hs�z$get_random_string.<locals>.<genexpr>)�NOT_PROVIDED�warnings�warnr�join�range)�lengthr'r
r&r�get_random_string7s�r/cCst�t|�t|��S)z:Return True if the two strings are equal, False otherwise.)r"�compare_digestr)�val1�val2r
r
r�constant_time_compareKsr3cCs<|durtj}|p
d}t|�}t|�}t�|�j||||�S)z)Return the hash of password using pbkdf2.N)r�sha256r�pbkdf2_hmac�name)�password�salt�
iterations�dklenrr
r
r�pbkdf2Psr;r!)rN)r	rrr"r*�django.confr�django.utils.deprecationr�django.utils.encodingr�
ValueErrorrr�objectr)�RANDOM_STRING_CHARSr/r3r;r
r
r
r�<module>s

https://t.me/RX1948 - 2025