Auth_OpenID_GmpMathWrapper
extends Auth_OpenID_MathLibrary
in package
Exposes GMP math library functionality.
Tags
Table of Contents
- $type : mixed
- add() : int
- base64ToLong() : mixed
- binaryToLong() : int
- Given a binary string, returns the binary string converted to a long number.
- cmp() : int
- div() : int
- init() : int
- longToBase64() : mixed
- longToBinary() : string
- Given a long integer, returns the number converted to a binary string. This function accepts long integer values of arbitrary magnitude and uses the local large-number math library when available.
- mod() : int
- mul() : int
- pow() : int
- powmod() : mixed
- rand() : int
- Returns a random number in the specified range. This function accepts $start, $stop, and $step values of arbitrary magnitude and will utilize the local large-number math library when available.
- sub() : mixed
- toString() : mixed
Properties
$type
public
mixed
$type
= 'gmp'
Methods
add()
public
add(mixed $x, mixed $y) : int
Parameters
- $x : mixed
- $y : mixed
Return values
int —base64ToLong()
public
base64ToLong(mixed $str) : mixed
Parameters
- $str : mixed
Return values
mixed —binaryToLong()
Given a binary string, returns the binary string converted to a long number.
public
binaryToLong(string $str) : int
Parameters
- $str : string
-
The binary version of a long number, probably as a result of calling longToBinary
Return values
int —$long The long number equivalent of the binary string $str
cmp()
public
cmp(mixed $x, mixed $y) : int
Parameters
- $x : mixed
- $y : mixed
Return values
int —div()
public
div(mixed $x, mixed $y) : int
Parameters
- $x : mixed
- $y : mixed
Return values
int —init()
public
init(mixed $number[, mixed $base = 10 ]) : int
Parameters
- $number : mixed
- $base : mixed = 10
Return values
int —longToBase64()
public
longToBase64(mixed $str) : mixed
Parameters
- $str : mixed
Return values
mixed —longToBinary()
Given a long integer, returns the number converted to a binary string. This function accepts long integer values of arbitrary magnitude and uses the local large-number math library when available.
public
longToBinary(int $long) : string
Parameters
- $long : int
-
The long number (can be a normal PHP integer or a number created by one of the available long number libraries)
Return values
string —$binary The binary version of $long
mod()
public
mod(mixed $base, mixed $modulus) : int
Parameters
- $base : mixed
- $modulus : mixed
Return values
int —mul()
public
mul(mixed $x, mixed $y) : int
Parameters
- $x : mixed
- $y : mixed
Return values
int —pow()
public
pow(mixed $base, mixed $exponent) : int
Parameters
- $base : mixed
- $exponent : mixed
Return values
int —powmod()
public
powmod(mixed $base, mixed $exponent, mixed $modulus) : mixed
Parameters
- $base : mixed
- $exponent : mixed
- $modulus : mixed
Return values
mixed —rand()
Returns a random number in the specified range. This function accepts $start, $stop, and $step values of arbitrary magnitude and will utilize the local large-number math library when available.
public
rand(int $stop) : int
Parameters
- $stop : int
-
The end of the range, or the maximum random number to return
Return values
int —$result The resulting randomly-generated number
sub()
public
sub(mixed $x, mixed $y) : mixed
Parameters
- $x : mixed
- $y : mixed
Return values
mixed —toString()
public
toString(mixed $num) : mixed
Parameters
- $num : mixed