o
    >e                     @   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   O/var/www/html/humari/django-venv/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   