
    h                        % S SK Jr  S SKrS SKrS SKrS SKrS SKrS SKrSrSr	\
" S \R                  \R                  R                  4 5       5      rS\S'   SS jrSS	 jr S       SS
 jjrSS jrSS jrg)    )annotationsN>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789i'	 c              #  >   #    U  H  oc  M  US:w  d  M  Uv   M     g 7f)N/ ).0seps     fC:\Users\ROHAN GUPTA\OneDrive\Desktop\mathbuddy-assessment\venv\Lib\site-packages\werkzeug/security.py	<genexpr>r      s      +CC3#:CC+s   	z	list[str]_os_alt_sepsc                f    U S::  a  [        S5      eSR                  S [        U 5       5       5      $ )zAGenerate a random string of SALT_CHARS with specified ``length``.r   zSalt length must be at least 1. c              3  V   #    U  H  n[         R                  " [        5      v   M!     g 7fN)secretschoice
SALT_CHARS)r   _s     r
   r   gen_salt.<locals>.<genexpr>   s     E}!7>>*--}s   '))
ValueErrorjoinrange)lengths    r
   gen_saltr      s.    {:;;77EuV}EEE    c           	     &   U S:X  a  [         R                  " SSS9  X 4$ U R                  S5      tpUR                  S5      nUR                  S5      nU S:X  a\  U(       d  SnS	nS
nO [	        [
        U5      u  pEnSU-  U-  U-  n[        R                  " X!XEXgS9R                  5       SU SU SU 34$ U S:X  a~  [        U5      nUS:X  a	  Sn	[        n
O7US
:X  a  US   n	[        n
O%US:X  a  US   n	[        US
   5      n
O[        S5      e[        R                  " XX5      R                  5       SU	 SU
 34$ [         R                  " SU  S3SS9  [        R                  " XU 5      R                  5       U 4$ ! [         a    [        S5      S ef = f)NplainznThe 'plain' password method is deprecated and will be removed in Werkzeug 3.0. Migrate to the 'scrypt' method.   )
stacklevel:zutf-8scrypti         z'scrypt' takes 3 arguments.   )saltnrpmaxmemzscrypt:pbkdf2r   sha256   z'pbkdf2' takes 2 arguments.zpbkdf2:zThe 'zd' password method is deprecated and will be removed in Werkzeug 3.0. Migrate to the 'scrypt' method.)warningswarnsplitencodemapintr   hashlibr!   hexlenDEFAULT_PBKDF2_ITERATIONSpbkdf2_hmachmacnew	hexdigest)methodr%   passwordargsr&   r'   r(   r)   len_args	hash_name
iterationss              r
   _hash_internalrA      s   =	

 LL%MF;;wDw'HAAAJc4.a q1qNN8!AMQQSaS!AaS!
 	
 
8	t9q= I2J]QI2J]QIT!WJ:;; 	TFJJLi[*.
 	

 	F8 = =	

 xx/99;VCCC  J !>?TIJs   (E9 9Fc                H    [        U5      n[        XU 5      u  pEU SU SU 3$ )a  Securely hash a password for storage. A password can be compared to a stored hash
using :func:`check_password_hash`.

The following methods are supported:

-   ``scrypt``, more secure but not available on PyPy. The parameters are ``n``,
    ``r``, and ``p``, the default is ``scrypt:32768:8:1``. See
    :func:`hashlib.scrypt`.
-   ``pbkdf2``, the default. The parameters are ``hash_method`` and ``iterations``,
    the default is ``pbkdf2:sha256:600000``. See :func:`hashlib.pbkdf2_hmac`.

Default parameters may be updated to reflect current guidelines, and methods may be
deprecated and removed if they are no longer considered secure. To migrate old
hashes, you may generate a new hash when checking an old hash, or you may contact
users with a link to reset their password.

:param password: The plaintext password.
:param method: The key derivation function and parameters.
:param salt_length: The number of characters to generate for the salt.

.. versionchanged:: 2.3
    Scrypt support was added.

.. versionchanged:: 2.3
    The default iterations for pbkdf2 was increased to 600,000.

.. versionchanged:: 2.3
    All plain hashes are deprecated and will not be supported in Werkzeug 3.0.
$)r   rA   )r<   r;   salt_lengthr%   hactual_methods         r
   generate_password_hashrG   S   s5    @ K D%fH=A_AdV1QC((r   c                     U R                  SS5      u  p#n[        R                  " [	        X#U5      S   U5      $ ! [         a     gf = f)a  Securely check that the given stored password hash, previously generated using
:func:`generate_password_hash`, matches the given password.

Methods may be deprecated and removed if they are no longer considered secure. To
migrate old hashes, you may generate a new hash when checking an old hash, or you
may contact users with a link to reset their password.

:param pwhash: The hashed password.
:param password: The plaintext password.

.. versionchanged:: 2.3
    All plain hashes are deprecated and will not be supported in Werkzeug 3.0.
rC   r,   Fr   )r/   r   r8   compare_digestrA   )pwhashr<   r;   r%   hashvals        r
   check_password_hashrL   x   sQ     &S! 4g ~fHEaH'RR  s   ; 
AAc                n  ^ U (       d  Sn U /nU H  mTS:w  a  [         R                  " T5      m[        U4S j[         5       5      (       d@  [        R
                  R                  T5      (       d  TS:X  d  TR                  S5      (       a    gUR                  T5        M     [         R                  " U6 $ )a  Safely join zero or more untrusted path components to a base
directory to avoid escaping the base directory.

:param directory: The trusted base directory.
:param pathnames: The untrusted path components relative to the
    base directory.
:return: A safe path, otherwise ``None``.
.r   c              3  ,   >#    U  H	  oT;   v   M     g 7fr   r   )r   r	   filenames     r
   r   safe_join.<locals>.<genexpr>   s     8<Cx<s   z..z../N)
	posixpathnormpathanyr   ospathisabs
startswithappendr   )	directory	pathnamespartsrP   s      @r
   	safe_joinr]      s      	KEr> ))(3H 8<888ww}}X&&4""5))X  >>5!!r   )r   r2   returnstr)r;   r_   r%   r_   r<   r_   r^   ztuple[str, str])r*      )r<   r_   r;   r_   rD   r2   r^   r_   )rJ   r_   r<   r_   r^   bool)rZ   r_   r[   r_   r^   z
str | None)
__future__r   r3   r8   rU   rR   r   r-   r   r6   listr	   rV   altsepr   __annotations__r   rA   rG   rL   r]   r   r   r
   <module>rf      s    "   	   M
"  FFBGGNN+ i 
F6Dt ?A")")")8;")")JS,"r   