parameters: (nbits)
docstring: Returns a prime number that can be stored in 'nbits' bits.
  
      >>> p = getprime(128)
      >>> is_prime(p-1)
      False
      >>> is_prime(p)
      True
      >>> is_prime(p+1)
      False
      
      >>> from rsa import common
      >>> common.bit_size(p) == 128
      True
docstring_summary: Returns a prime number that can be stored in 'nbits' bits.
docstring_tokens: Returns a prime number that can be stored in nbits bits .
function: def getprime(nbits):
      '''Returns a prime number that can be stored in 'nbits' bits.
  
      >>> p = getprime(128)
      >>> is_prime(p-1)
      False
      >>> is_prime(p)
      True
      >>> is_prime(p+1)
      False
      
      >>> from rsa import common
      >>> common.bit_size(p) == 128
      True
      
      '''
  
      while True:
          integer = rsa.randnum.read_random_int(nbits)
  
          # Make sure it's odd
          integer |= 1
  
          # Test for primeness
          if is_prime(integer):
              return integer
function_tokens: def getprime ( nbits ) : while True : integer = rsa . randnum . read_random_int ( nbits ) # Make sure it's odd integer |= 1 # Test for primeness if is_prime ( integer ) : return integer