class

Crypto::Prime::PseudoPrimeGenerator

Inherits Iterator / Enumerable / Enumerable / Reference / Object

An abstract class for enumerating pseudo-prime numbers.

Concrete subclasses should override succ, next, rewind.

Constructors

new(ubound : Int128 | Int16 | Int32 | Int64 | Int8 | Nil = nil)
Source

Instance methods

each

Iterates the given block for each prime number.

Source
next

alias of succ.

Source
rewind

Rewinds the internal position for enumeration.

Source
size

Returns the number of elements in the collection.

[1, 2, 3, 4].size # => 4
Source
succ

returns the next pseudo-prime number, and move the internal position forward.

Source
upper_bound
Source
upper_bound=(ubound : Int128 | Int16 | Int32 | Int64 | Int8 | Nil)
Source