U
    ÎZj  ã                   @   sŽ   U d dl mZ d dlmZmZ d dlmZ e ¡ Z	e
ed< e ¡ Ze
ed< e ¡ Ze
ed< eedœdd	„Zeedœd
d„Zeedœdd„ZdS )é    )Ú
exceptions)ÚffiÚlib)ÚensureÚcrypto_hash_BYTESÚcrypto_hash_sha256_BYTESÚcrypto_hash_sha512_BYTES)ÚmessageÚreturnc                 C   sF   t  dt¡}t || t| ƒ¡}t|dkdtjd� t  	|t¡dd… S ©zb
    Hashes and returns the message ``message``.

    :param message: bytes
    :rtype: bytes
    zunsigned char[]r   zUnexpected library error)ZraisingN)
r   Únewr   r   Úcrypto_hashÚlenr   ÚexcÚRuntimeErrorÚbuffer©r	   ÚdigestÚrc© r   ú\/var/www/html/TRUCKING_PROJECT/venv/lib/python3.8/site-packages/nacl/bindings/crypto_hash.pyr      s    r   c                 C   sF   t  dt¡}t || t| ƒ¡}t|dkdtjd� t  	|t¡dd… S r   )
r   r   r   r   Úcrypto_hash_sha256r   r   r   r   r   r   r   r   r   r   (   s    r   c                 C   sF   t  dt¡}t || t| ƒ¡}t|dkdtjd� t  	|t¡dd… S r   )
r   r   r   r   Úcrypto_hash_sha512r   r   r   r   r   r   r   r   r   r   5   s    r   N)Znaclr   r   Znacl._sodiumr   r   Znacl.exceptionsr   Zcrypto_hash_sha512_bytesr   ÚintÚ__annotations__Zcrypto_hash_sha256_bytesr   r   Úbytesr   r   r   r   r   r   r   Ú<module>   s    