HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib/python3.10/site-packages/bcrypt/__pycache__/__init__.cpython-310.pyc
o

!we��
@s�ddlmZddlmZddlZddlZddlZddlmZmZm	Z	m
Z
mZmZm
Z
mZddlmZgd�Zdd
ededefd
d�Zdededefdd�Zdededefdd�Z	ddededed
ededefdd�ZdS)�)�absolute_import)�divisionN�)�
__author__�
__copyright__�	__email__�__license__�__summary__�	__title__�__uri__�__version__)�_bcrypt)r
r	rrrrrr�gensalt�hashpw�kdf�checkpw��2b�rounds�prefix�returncCs^|dvrtd��|dks|dkrtd��t�d�}t�|�}d|dd|�d	�d|S)
N)s2arz%Supported prefixes are b'2a' or b'2b'��zInvalid rounds��$z%2.2u�ascii)�
ValueError�os�urandomr
�
encode_base64�encode)rr�salt�output�r#�H/home/arjun/projects/env/lib/python3.10/site-packages/bcrypt/__init__.pyr4s$

������r�passwordr!cCs4t|t�s
t|t�rtd��|dd�}t�||�S)N�&Strings must be encoded before hashing�H)�
isinstance�str�	TypeErrorr
�hashpass)r%r!r#r#r$rHsr�hashed_passwordcCs2t|t�s
t|t�rtd��t||�}t�||�S)Nz'Strings must be encoded before checking)r(r)r*r�hmac�compare_digest)r%r,�retr#r#r$rWs
rF�desired_key_bytes�ignore_few_roundscCs�t|t�s
t|t�rtd��t|�dkst|�dkrtd��|dks&|dkr*td��|dkr2td��|dkrC|sCtjd	�|�td
d�t	�
||||�S)Nr&rz#password and salt must not be emptyizdesired_key_bytes must be 1-512rzrounds must be 1 or more�2zrWarning: bcrypt.kdf() called with only {0} round(s). This few is not secure: the parameter is linear, like PBKDF2.�)�
stacklevel)r(r)r*�lenr�warnings�warn�format�UserWarningr
�pbkdf)r%r!r0rr1r#r#r$r_s �	r)rr)F)�
__future__rrr-rr6�	__about__rrrrr	r
rr�r
�__all__�int�bytesrr�boolrrr#r#r#r$�<module>s2(

�������