o
    ǯh(                     @   s   U d dl Z d dlmZ d dlmZmZ d dlmZ d dlmZ d dl	m
Z
 dedefd	d
ZdedefddZdefddZdedefddZdedefddZdedefddZe
eeZeed< dS )    N)timegm)datetimetimezone)Callable)settings)lazypasswordreturnc                 C   s   t |    S )z0
    Returns MD5 hash of the given password
    )hashlibmd5encode	hexdigestupper)r    r   [/var/www/Befach/backend/venv/lib/python3.10/site-packages/rest_framework_simplejwt/utils.pyget_md5_hash_password
   s   r   dtc                 C   s"   t jr| jd u r| jtjdS | S )Ntzinfo)r   USE_TZr   replacer   utcr   r   r   r   make_utc   s   r   c                  C   s$   t jtjd} tjs| jd d} | S N)tzr   )r   nowr   r   r   r   r   r   r   r   r   aware_utcnow   s   r   c                 C   s   t |  S N)r   utctimetupler   r   r   r   datetime_to_epoch    s   r    tsc                 C   s&   t j| tjd}tjs|jd d}|S r   )r   fromtimestampr   r   r   r   r   )r!   r   r   r   r   datetime_from_epoch$   s   r#   sc                 O   s   | j |i |S r   )format)r$   argskwargsr   r   r   format_lazy,   s   r(   )r
   calendarr   r   r   typingr   django.confr   django.utils.functionalr   strr   r   r   intr    floatr#   r(   __annotations__r   r   r   r   <module>   s   
 