 exports.nbs = nbs
 exports.small_primes = small_primes
 exports.miller_rabin = miller_rabin
-
+exports.random_prime = random_prime
+
+await random_prime 3072, 32, defer p
+console.log p.toString()
+process.exit -1
+

# @param {BigInteger} p 
# @param {number} d
# @return {number} p%d
quickmod = (p, d) -> p.modInt(d)

#--------------


  # @return {BigInteger} the next weak prime
  #
  next_weak : () ->
    try_again = true
    while try_again

      step = @sieve[@sievepos]
      @sievepos = (@sievepos + step) % @sieve.length
