Your IP : 3.138.126.233
o
S�g�'� @sldZdZee�Zee�ZedZiZddhZdd�Zdd�Z dd
d�Z
ddd
�ZzddlZeZ
e Ze�ej�ZWneyGdZe
Z
eZYnwzddlmZWn*eyzddlmZedd�ed�D��Zedd�ed�D��Zddd�ZYnwzddlmZWn ey�YnweD]Zz ee�e�e<Wq�ey�ddlZe�de�Yq�w[[[[
[[ dS)a3hashlib module - A common interface to many hash functions.
new(name, data=b'', **kwargs) - returns a new hash object implementing the
given hash function; initializing the hash
using the given binary data.
Named constructor functions are also available, these are faster
than using new(name):
md5(), sha1(), sha224(), sha256(), sha384(), sha512(), blake2b(), blake2s(),
sha3_224, sha3_256, sha3_384, sha3_512, shake_128, and shake_256.
More algorithms may be available on your platform but the above are guaranteed
to exist. See the algorithms_guaranteed and algorithms_available attributes
to find out what algorithm names can be passed to new().
NOTE: If you want the adler32 or crc32 hash functions they are available in
the zlib module.
Choose your hash function wisely. Some have known collision weaknesses.
sha384 and sha512 will be slow on 32 bit platforms.
Hash objects have these methods:
- update(data): Update the hash object with the bytes in data. Repeated calls
are equivalent to a single call with the concatenation of all
the arguments.
- digest(): Return the digest of the bytes passed to the update() method
so far as a bytes object.
- hexdigest(): Like digest() except the digest is returned as a string
of double length, containing only hexadecimal digits.
- copy(): Return a copy (clone) of the hash object. This can be used to
efficiently compute the digests of datas that share a common
initial substring.
For example, to obtain the digest of the byte string 'Nobody inspects the
spammish repetition':
>>> import hashlib
>>> m = hashlib.md5()
>>> m.update(b"Nobody inspects")
>>> m.update(b" the spammish repetition")
>>> m.digest()
b'\xbbd\x9c\x83\xdd\x1e\xa5\xc9\xd9\xde\xc9\xa1\x8d\xf0\xff\xe9'
More condensed:
>>> hashlib.sha224(b"Nobody inspects the spammish repetition").hexdigest()
'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2'
)�md5�sha1�sha224�sha256�sha384�sha512�blake2b�blake2s�sha3_224�sha3_256�sha3_384�sha3_512� shake_128� shake_256)�new�algorithms_guaranteed�algorithms_available�pbkdf2_hmacrrc Cs�t}|�|�}|dur
|Sz�|dvr ddl}|j|d<|d<n�|dvr2ddl}|j|d<|d<nx|dvrMddl}|j|d <|d
<|j|d<|d<n]|d
vrhddl }|j
|d<|d<|j|d<|d<nB|dvr{ddl}|j
|d<|j|d<n/|dvr�ddl}|j|d<|j|d<|j|d<|j|d<n|dvr�ddl}|j|d<|j|d<Wn ty�Ynw|�|�}|dur�|Std|��)N>�SHA1r�rr>r�MD5rr>�SHA256rr�SHA224rrrr>�SHA384r�SHA512rrrrr>rrrr>r
r rrr r
rr>rr
r
rzunsupported hash type )�__builtin_constructor_cache�get�_sha1r�_md5r�_sha256rr�_sha512rr�_blake2rr�_sha3r r
rrr
r�ImportError�
ValueError) �name�cache�constructorrrrrr r!�r'�./opt/alt/python310/lib64/python3.10/hashlib.py�__get_builtin_constructorRsR
��
r)c CsN|tvrt|�Szttd|�}|dd�|WSttfy&t|�YSw)NZopenssl_F)Zusedforsecurity)�__block_openssl_constructorr)�getattr�_hashlib�AttributeErrorr#)r$�fr'r'r(�__get_openssl_constructor~s
�r/�cKst|�|fi|��S)z�new(name, data=b'', **kwargs) - Return a new hashing object using the
named algorithm; optionally initialized with data (which must be
a bytes-like object).
)r)�r$�data�kwargsr'r'r(�__py_new�sr4cKsR|tvrt|�|fi|��Sztj||fi|��WSty(t|�|�YSw)z�new(name, data=b'') - Return a new hashing object using the named algorithm;
optionally initialized with data (which must be a bytes-like object).
)r*r)r,rr#r1r'r'r(�
__hash_new�s�r5rN)r)�warncc��|]}|dAVqdS)�\Nr'��.0�xr'r'r(� <genexpr>���r<�ccr7)�6Nr'r9r'r'r(r<�r=cCs�tdtdd�t|t�st|��t|ttf�stt|��}t|ttf�s*tt|��}t|�}t|�}t |dd�}t
|�|krEt||���}|d|t
|�}|�|�
t��|�|�
t��||fdd�}|d krnt|��|d
uru|j}|d kr}t|��d} d }
tj}t
| �|kr�|||
�dd
��}t�|d
�}
t|d �D]
}||�}|
||d
�N}
q�|
d 7}
| |
�|jd
�7} t
| �|ks�| d
|�S)z�Password based key derivation function 2 (PKCS #5 v2.0)
This Python implementations based on the hmac module about as fast
as OpenSSL's PKCS5_PBKDF2_HMAC for short passwords and much faster
for long passwords.
z5Python implementation of pbkdf2_hmac() is deprecated.�)�category�
stacklevelZ
block_size�@�cSs0|��}|��}|�|�|�|���|��S�N)�copy�update�digest)�msg�inner�outerZicpyZocpyr'r'r(�prf�s
zpbkdf2_hmac.<locals>.prf�Nr0�Zbig)�_warn�DeprecationWarning�
isinstance�str� TypeError�bytes� bytearray�
memoryviewrr+�lenrHrG� translate� _trans_36� _trans_5Cr#Zdigest_size�int�
from_bytes�to_bytes�range)Z hash_nameZpasswordZsaltZ
iterationsZdklenrJrKZ blocksizerLZdkeyZloopr\�prevZrkey�ir'r'r(r�sN�
�r)�scryptzcode for hash %s was not found.)r0rE) �__doc__Z__always_supported�setrr�__all__rr*r)r/r4r5r,rZ
__get_hash�unionZopenssl_md_meth_namesr"r�warningsr6rOrTr^rZrYraZ__func_name�globalsr#ZloggingZ exceptionr'r'r'r(�<module>s\5�,
���C��
?>