def read_random_int(nbits):

    nbytes = ceil(nbits/8.)
    randomdata = os.urandom(nbytes)
    return bytes2int(randomdata)
Reads a random integer of approximately nbits bits rounded up
dataset/ETHPy150Open CouchPotato/CouchPotatoServer/libs/rsa/_version133.py/read_random_int