%PDF- %PDF-
| Direktori : /lib/python3.9/site-packages/passlib/handlers/__pycache__/ |
| Current File : //lib/python3.9/site-packages/passlib/handlers/__pycache__/bcrypt.cpython-39.opt-1.pyc |
a
f�WcN� � @ s
d Z ddlmZmZ ddlmZ ddlmZ ddlZddl Z ddl
Z
e
�e�Z
ddlmZ dadadadaddlmZ ddlmZmZmZ dd lmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z% dd
l&m'Z' ddl(m)Z) ddl(m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/ ddl0m1 m2Z3 d
gZ4e*d�Z5e*d�Z6e*d�Z7e*d�Z8e*d�Z9dZ:dZ;dd� Z<G dd� de3j=e3j>e3j?e3j@e3jAe3jB�ZCG dd� deC�ZDG dd� deC�ZEG dd� deC�ZFG dd � d eC�ZGG d!d"� d"eC�ZHG d#d$� d$eC�ZIG d%d
� d
eDeC�ZJe*d&�ZKG d'd(� d(eJ�ZLG d)d*� d*eL�ZMdS )+z�passlib.bcrypt -- implementation of OpenBSD's BCrypt algorithm.
TODO:
* support 2x and altered-2a hashes?
http://www.openwall.com/lists/oss-security/2011/06/27/9
* deal with lack of PY3-compatibile c-ext implementation
� )�with_statement�absolute_import)� b64encode)�sha256N)�warn)�compile_hmac)�PasslibHashWarning�PasslibSecurityWarning�PasslibSecurityError)�
safe_crypt�
repeat_string�to_bytes�
parse_version�rng�
getrandstr�
test_crypt�
to_unicode�
utf8_truncate�utf8_repeat_string�crypt_accepts_bytes)�bcrypt64)�get_unbound_method_function)�u�
uascii_to_str�unicode�
str_to_uascii�PY3�
error_from�bcryptz$2$z$2a$z$2x$z$2y$z$2b$� z<$2a$04$5BJqKfqMQvV7nS.yUguNcueVirQqDBGaLXSqj.rs.pZPlNR0UX/HKc C sL zddl } W n ty Y dS 0 zddlm} W n tyF Y dS 0 dS )a!
internal helper which tries to distinguish pybcrypt vs bcrypt.
:returns:
True if cext-based py-bcrypt,
False if ffi-based bcrypt,
None if 'bcrypt' module not found.
.. versionchanged:: 1.6.3
Now assuming bcrypt installed, unless py-bcrypt explicitly detected.
Previous releases assumed py-bcrypt by default.
Making this change since py-bcrypt is (apparently) unmaintained and static,
whereas bcrypt is being actively maintained, and it's internal structure may shift.
r N)�__version__FT)r �ImportErrorZbcrypt._bcryptr )r r � r"