def _getRandomNumber(random, bits):
    if bits % 8:
        raise ValueError("bits (%d) must be a multiple of 8" % (bits,))
    return int_from_bytes(random(bits // 8), 'big')
Generate a random number in the range [0, 2 ** bits).
dataset/ETHPy150Open twisted/twisted/twisted/conch/ssh/transport.py/_getRandomNumber