[][src]Struct ramp_primes::Generator

pub struct Generator;

Implementations

impl Generator[src]

pub fn new_composite(n: usize) -> Int[src]

Generates a composite number

pub fn new_uint(n: usize) -> Int[src]

Large Unsigned Integer Generator

This function takes as input n, the bit-length specified for the integer.

Example

use ramp_primes::Generator;
 
fn main(){
    // Outputs a Large Integer with 1024 bits
    let large_uint = Generator::new_uint(1024);
}

pub fn new_prime(n: usize) -> Int[src]

Large Prime Generator

This function takes as input n, the bit-length specified for the prime number.

Example

use ramp_primes::Generator;
 
fn main(){
    // Outputs a Large Prime with 512 bits
    let p = Generator::new_prime(512);
    let q = Generator::new_prime(512);
 
    // Multiplies p times q and returns the product
    let n = p * q;
}

pub fn new_safe_prime(n: usize) -> Int[src]

Safe Prime Generator

This function takes as input n, the bit-length specified for the safe prime number. This function is slower than prime number generation itself.

Example

use ramp_primes::Generator;
 
fn main(){
    // Outputs a Large Prime with 64 bits
    let p = Generator::safe_prime(64);
}

pub fn new_safe_prime_experimental(n: usize) -> Int[src]

This function adds a 2x speed boost to safe prime generation but also may return an Int that is not of the specified size

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.