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')

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 .