def getRandomNBitInteger(N, randfunc=None):
 value = getRandomInteger((N - 1), randfunc)
 value |= (2 ** (N - 1))
 assert (size(value) >= N)
 return value

def getRandomNBitInteger ( N , randfunc = None ) : value = getRandomInteger ( ( N - 1 ) , randfunc ) value |= ( 2 ** ( N - 1 ) ) assert ( size ( value ) >= N ) return value
getrandominteger:long return a random number with exactly n-bits .