Trait num_bigint_dig::RandBigInt
source · pub trait RandBigInt {
// Required methods
fn gen_biguint(&mut self, bit_size: usize) -> BigUint;
fn gen_bigint(&mut self, bit_size: usize) -> BigInt;
fn gen_biguint_below(&mut self, bound: &BigUint) -> BigUint;
fn gen_biguint_range(
&mut self,
lbound: &BigUint,
ubound: &BigUint
) -> BigUint;
fn gen_bigint_range(&mut self, lbound: &BigInt, ubound: &BigInt) -> BigInt;
}
Required Methods§
sourcefn gen_biguint(&mut self, bit_size: usize) -> BigUint
fn gen_biguint(&mut self, bit_size: usize) -> BigUint
Generate a random BigUint
of the given bit size.
sourcefn gen_bigint(&mut self, bit_size: usize) -> BigInt
fn gen_bigint(&mut self, bit_size: usize) -> BigInt
Generate a random BigInt of the given bit size.
sourcefn gen_biguint_below(&mut self, bound: &BigUint) -> BigUint
fn gen_biguint_below(&mut self, bound: &BigUint) -> BigUint
Generate a random BigUint
less than the given bound. Fails
when the bound is zero.
sourcefn gen_biguint_range(&mut self, lbound: &BigUint, ubound: &BigUint) -> BigUint
fn gen_biguint_range(&mut self, lbound: &BigUint, ubound: &BigUint) -> BigUint
Generate a random BigUint
within the given range. The lower
bound is inclusive; the upper bound is exclusive. Fails when
the upper bound is not greater than the lower bound.
sourcefn gen_bigint_range(&mut self, lbound: &BigInt, ubound: &BigInt) -> BigInt
fn gen_bigint_range(&mut self, lbound: &BigInt, ubound: &BigInt) -> BigInt
Generate a random BigInt
within the given range. The lower
bound is inclusive; the upper bound is exclusive. Fails when
the upper bound is not greater than the lower bound.