BigIntHelper

Members

Static functions

fromBytes
BigInt fromBytes(in ubyte[] buffer)

Because std.bigint's member data is a private property, and there is no API setDigit that opens the opposite of getDigit, it can only be shifted by digits one by one. !! Here is a performance bottleneck.

isProbablePrime
bool isProbablePrime(const BigInt n, const size_t confidence)

Test whether BigInt n is prime. Step 1: millerRabinPrimeTest Step 2: lucasLehmerTest

mul
BigInt mul(const BigInt a, const BigInt b)

Bug BigInt mul() of phobos will be fixed in version 2.087.0 Details: https://github.com/dlang/phobos/pull/6972

powmod
BigInt powmod(const BigInt base, const BigInt exponent, const BigInt modulus)
randomGenerate
BigInt randomGenerate(uint bitLength, int highBit = -1, int lowBit = -1)

Random generate a BigInt by bitLength.

randomGenerate
BigInt randomGenerate(const BigInt min, const BigInt max)

Random generate a BigInt between min and max.

toUBytes
ubyte[] toUBytes(const BigInt value)

Meta