Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

OpenSSL::BN#prime_fasttest?

bn.prime_fasttest? => true | false
bn.prime_fasttest?(checks) => true | false
bn.prime_fasttest?(checks, trial_div) => true | false

Performs a Miller-Rabin primality test. This is same as prime? except this first attempts trial divisions with some small primes.

Parameters

  • checks - integer

  • trial_div - boolean

See also #prime? #rshift! #pretty_print #set_bit! also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1