abstract class Crypto::Prime::PseudoPrimeGenerator

Overview

An abstract class for enumerating pseudo-prime numbers.

Concrete subclasses should override succ, next, rewind.

Included Modules

Direct Known Subclasses

Defined in:

crypto/utils/prime.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(ubound : Int128 | Int16 | Int32 | Int64 | Int8 | Nil = nil) #

[View source]

Instance Method Detail

def each(&) #

Iterates the given block for each prime number.


[View source]
def next #

alias of #succ.


[View source]
abstract def rewind : self #

Rewinds the internal position for enumeration.


[View source]
def size #
Description copied from module Enumerable(Int128 | Int16 | Int32 | Int64 | Int8)

Returns the number of elements in the collection.

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

[View source]
abstract def succ : Int::Signed #

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


[View source]
def upper_bound : Int128 | Int16 | Int32 | Int64 | Int8 | Nil #

[View source]
def upper_bound=(ubound : Int128 | Int16 | Int32 | Int64 | Int8 | Nil) #

[View source]