ruạṛ
a ���f � @ s( d Z ddlZdd� Zdd� Zdd� ZdS )zd This package provides random methods that considered secure for certain static code analysis tools � Nc C s| | |krt d��nf| |kr| S || d }d}tt�d��� d�}|||| krhtt�d��� d�}qB||; }| | S dS )z� Python random.randint() is considered insecure. We use this function to get around of the restriction. :param a: lower bound :param b: upper bound :return: Return a random integer N such that a <= N <= b. z'Lower bound is larger than upper bound.� l �� � � N)� ValueError�int�os�urandom�hex)�a�b�m�rand_max�n� r �M/sparta/input/python_modules/oci_agent_utils/oci_agent_utils/secure_random.py� random_int s r c C s6 t | �} t| �}|dkr td��td|d �}| | S )�.Pick a random element of the given small arrayr zCannot pick from an empty arrayr ��list�lenr r ��source�length�positionr r r �random_element s r c C s6 t | �} t| �}|dkr td��td|d �}| | S )r r zCannot pick from empty arrayr r r r r r r * s )�__doc__r r r r r r r �<module> s
cải xoăn