Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
proc
/
thread-self
/
root
/
usr
/
lib
/
python2.7
/
site-packages
/
rsa
/
File Content:
randnum.pyc
� π�Vc @ s` d Z d d l Z d d l m Z m Z d d l m Z d � Z d � Z d � Z d � Z d S( s( Functions for generating random numbers.i����N( t commont transform( t bytec C sj t | d � \ } } t j | � } | d k rf t t j d � � } | d | L} t | � | } n | S( s� Reads 'nbits' random bits. If nbits isn't a whole number of bytes, an extra byte will be appended with only the lower bits set. i i i ( t divmodt ost urandomt ordR ( t nbitst nbytest rbitst randomdatat randomvalue( ( s/ /usr/lib/python2.7/site-packages/rsa/randnum.pyt read_random_bits s c C s1 t | � } t j | � } | d | d >O} | S( s8 Reads a random integer of approximately nbits bits. i ( R R t bytes2int( R R t value( ( s/ /usr/lib/python2.7/site-packages/rsa/randnum.pyt read_random_int0 s c C s t | � } | d BS( sh Reads a random odd integer of approximately nbits bits. >>> read_random_odd_int(512) & 1 1 i ( R ( R R ( ( s/ /usr/lib/python2.7/site-packages/rsa/randnum.pyt read_random_odd_int>