def getPrime(N, randfunc=None):
 if (randfunc is None):
  _import_Random()
  randfunc = Random.new().read
 number = (getRandomNBitInteger(N, randfunc) | 1)
 while (not isPrime(number, randfunc=randfunc)):
  number = (number + 2)
 return number

def getPrime ( N , randfunc = None ) : if ( randfunc is None ) : _import_Random ( ) randfunc = Random . new ( ) . read number = ( getRandomNBitInteger ( N , randfunc ) | 1 ) while ( not isPrime ( number , randfunc = randfunc ) ) : number = ( number + 2 ) return number
getprime:long return a random n-bit prime number .