o
    -×¾g  ã                   @   sN   d dl mZmZmZmZ d dlZddlmZ ddlm	Z	m
Z
 dgZdd„ ZdS )é    )Úunicode_literalsÚdivisionÚabsolute_importÚprint_functionNé   )Úpretty_message)Ú	type_nameÚ	int_typesÚ
rand_bytesc                 C   sF   t | tƒsttdt| ƒƒƒ‚| dk rtdƒ‚| dkrtdƒ‚t | ¡S )a}  
    Returns a number of random bytes suitable for cryptographic purposes

    :param length:
        The desired number of bytes

    :raises:
        ValueError - when any of the parameters contain an invalid value
        TypeError - when any of the parameters are of the wrong type
        OSError - when an error is returned by OpenSSL

    :return:
        A byte string
    z;
            length must be an integer, not %s
            r   zlength must be greater than 0i   z$length must not be greater than 1024)Ú
isinstancer	   Ú	TypeErrorr   r   Ú
ValueErrorÚosÚurandom)Úlength© r   úX/var/www/html/backend_erp/backend_erp_env/lib/python3.10/site-packages/oscrypto/_rand.pyr
      s   
ü
)Ú
__future__r   r   r   r   r   Ú_errorsr   Ú_typesr   r	   Ú__all__r
   r   r   r   r   Ú<module>   s   ÿ