
    z%i                         	 g d Z ddlZddlmZ ddlmZ  e       Zej                  Zej                  Z	d Z
dZd
dZd
dZd
d	Zy))choice	randbelowrandbitsSystemRandomtoken_bytes	token_hextoken_urlsafecompare_digest    N)r	   )r   c                 N    	 | dk  rt        d      t        j                  |       S )Nr
   zUpper bound must be positive.)
ValueError_sysrand
_randbelow)exclusive_upper_bounds    ;/home/uftp/.pyenv/versions/3.12.0/lib/python3.12/secrets.pyr   r      s+    2!899455        c                 >    	 | t         } t        j                  |       S N)DEFAULT_ENTROPYr   	randbytesnbytess    r   r   r   !   s$     ~ f%%r   c                 6    	 t        |       j                         S r   )r   hexr   s    r   r   r   /   s    	 v""$$r   c                     	 t        |       }t        j                  |      j                  d      j	                  d      S )N   =ascii)r   base64urlsafe_b64encoderstripdecode)r   toks     r   r   r   <   s:     f
C##C(//5<<WEEr   r   )__all__r   hmacr	   randomr   r   getrandbitsr   r   r   r   r   r   r    r   r   <module>r(      sS      >	6 &%Fr   