C# Class Mono.Math.BigInteger

Datei anzeigen Open project: rackerlabs/openstack-guest-agents-windows-xenserver Class Usage Examples

Public Properties

Property Type Description
smallPrimes uint[]

Private Properties

Property Type Description
Normalize void
isProbablePrime bool

Public Methods

Method Description
BigInteger ( ) : System
BigInteger ( BigInteger bi ) : System
BigInteger ( BigInteger bi, uint len ) : System
BigInteger ( Sign sign, uint len ) : System
BigInteger ( byte inData ) : System
BigInteger ( uint inData ) : System
BigInteger ( ulong ul ) : System
Clear ( ) : void
Compare ( BigInteger bi ) : Sign
Equals ( object o ) : bool
GetHashCode ( ) : int
Incr2 ( ) : void

Increments this by two

LowestSetBit ( ) : int
NextHightestPrime ( BigInteger bi ) : BigInteger

Generates the smallest prime >= bi

Parse ( string number ) : BigInteger
ToString ( ) : string
ToString ( uint radix ) : string
ToString ( uint radix, string charSet ) : string
bitCount ( ) : int
clearBit ( uint bitNum ) : void
gcd ( BigInteger bi ) : BigInteger
genPseudoPrime ( int bits ) : BigInteger
genRandom ( int bits ) : BigInteger

Generates a new, random BigInteger of the specified length using the default RNG crypto service provider.

genRandom ( int bits, RandomNumberGenerator rng ) : BigInteger

Generates a new, random BigInteger of the specified length.

getBytes ( ) : byte[]
isProbablePrime ( ) : bool
modInverse ( BigInteger mod ) : BigInteger
modPow ( BigInteger exp, BigInteger n ) : BigInteger
operator ( ) : BigInteger
operator ( ) : bool
operator ( ) : int
operator ( ) : uint
randomize ( ) : void

Randomizes the bits in "this" from the default RNG.

randomize ( RandomNumberGenerator rng ) : void

Randomizes the bits in "this" from the specified RNG.

setBit ( uint bitNum ) : void
setBit ( uint bitNum, bool val ) : void
testBit ( int bitNum ) : bool
testBit ( uint bitNum ) : bool

Tests if the specified bit is 1.

Private Methods

Method Description
Normalize ( ) : void

Normalizes this by setting the length to the actual number of uints used in data and by setting the sign to Sign.Zero if the value of this is 0.

isProbablePrime ( int notUsed ) : bool

Method Details

BigInteger() public method

public BigInteger ( ) : System
return System

BigInteger() public method

public BigInteger ( BigInteger bi ) : System
bi BigInteger
return System

BigInteger() public method

public BigInteger ( BigInteger bi, uint len ) : System
bi BigInteger
len uint
return System

BigInteger() public method

public BigInteger ( Sign sign, uint len ) : System
sign Sign
len uint
return System

BigInteger() public method

public BigInteger ( byte inData ) : System
inData byte
return System

BigInteger() public method

public BigInteger ( uint inData ) : System
inData uint
return System

BigInteger() public method

public BigInteger ( ulong ul ) : System
ul ulong
return System

Clear() public method

public Clear ( ) : void
return void

Compare() public method

public Compare ( BigInteger bi ) : Sign
bi BigInteger
return Sign

Equals() public method

public Equals ( object o ) : bool
o object
return bool

GetHashCode() public method

public GetHashCode ( ) : int
return int

Incr2() public method

Increments this by two
public Incr2 ( ) : void
return void

LowestSetBit() public method

public LowestSetBit ( ) : int
return int

NextHightestPrime() public static method

Generates the smallest prime >= bi
public static NextHightestPrime ( BigInteger bi ) : BigInteger
bi BigInteger A BigInteger
return BigInteger

Parse() public static method

public static Parse ( string number ) : BigInteger
number string
return BigInteger

ToString() public method

public ToString ( ) : string
return string

ToString() public method

public ToString ( uint radix ) : string
radix uint
return string

ToString() public method

public ToString ( uint radix, string charSet ) : string
radix uint
charSet string
return string

bitCount() public method

public bitCount ( ) : int
return int

clearBit() public method

public clearBit ( uint bitNum ) : void
bitNum uint
return void

gcd() public method

public gcd ( BigInteger bi ) : BigInteger
bi BigInteger
return BigInteger

genPseudoPrime() public static method

public static genPseudoPrime ( int bits ) : BigInteger
bits int
return BigInteger

genRandom() public static method

Generates a new, random BigInteger of the specified length using the default RNG crypto service provider.
public static genRandom ( int bits ) : BigInteger
bits int The number of bits for the new number.
return BigInteger

genRandom() public static method

Generates a new, random BigInteger of the specified length.
public static genRandom ( int bits, RandomNumberGenerator rng ) : BigInteger
bits int The number of bits for the new number.
rng System.Security.Cryptography.RandomNumberGenerator A random number generator to use to obtain the bits.
return BigInteger

getBytes() public method

public getBytes ( ) : byte[]
return byte[]

isProbablePrime() public method

public isProbablePrime ( ) : bool
return bool

modInverse() public method

public modInverse ( BigInteger mod ) : BigInteger
mod BigInteger
return BigInteger

modPow() public method

public modPow ( BigInteger exp, BigInteger n ) : BigInteger
exp BigInteger
n BigInteger
return BigInteger

operator() public static method

public static operator ( ) : BigInteger
return BigInteger

operator() public static method

public static operator ( ) : bool
return bool

operator() public static method

public static operator ( ) : int
return int

operator() public static method

public static operator ( ) : uint
return uint

randomize() public method

Randomizes the bits in "this" from the default RNG.
public randomize ( ) : void
return void

randomize() public method

Randomizes the bits in "this" from the specified RNG.
public randomize ( RandomNumberGenerator rng ) : void
rng System.Security.Cryptography.RandomNumberGenerator A RNG.
return void

setBit() public method

public setBit ( uint bitNum ) : void
bitNum uint
return void

setBit() public method

public setBit ( uint bitNum, bool val ) : void
bitNum uint
val bool
return void

testBit() public method

public testBit ( int bitNum ) : bool
bitNum int
return bool

testBit() public method

Tests if the specified bit is 1.
public testBit ( uint bitNum ) : bool
bitNum uint The bit to test. The least significant bit is 0.
return bool

Property Details

smallPrimes public_oe static_oe property

Table of primes below 2000.

This table was generated using Mathematica 4.1 using the following function:

PrimeTable [x_] := Prime [Range [1, PrimePi [x]]] PrimeTable [6000]

public static uint[] smallPrimes
return uint[]