   s = obj.p.toString()
   interval = if obj.total? and obj.i? then "(#{obj.i} of #{obj.total})" else ""
   console.log "+ #{obj.what} #{interval} #{s[0...3]}....#{s[(s.length-6)...]}"
-await random_prime 3072, 10, defer(p), progress_hook
+await random_prime { nbits : 1024, iters : 10, progress_hook, e : nbv((1 << 16) + 1) }, defer p
 console.log p.toString()
 process.exit -1
 

    await srf.recharge defer()
    p = new BigInteger nbits, srf
    p = p.setBit(0).setBit(nbits-1)
    progress_hook? { what : "guess", p }
    p = prime_search p, nbits/4, sieve, progress_hook, iters
    go = (p.compareTo(BigInteger.ZERO) is 0)
  progress_hook? { what : "found", p }
  cb p


# @param {number} iters The number of time to run Miller-Rabin
# @param {callback} Callback with the {BigInteger} result
# @param {function} progress_hook A hook to call to update progress
# @param {BigInteger} e The generated prime must p must have gcd(p-1,e) = 1
#   if specified. If not, this check isn't performed. This is useful for RSA.
#   It saves a tiny bit of work, but not much if e = 2^16+1 as usual.
#
random_prime = ({nbits, iters, progress_hook, e}, cb) ->
  srf = new StrongRandomFountain()
  sieve = [1,2]
  go = true
