PHP Class Jose\Util\BigInteger

Afficher le fichier Open project: spomky-labs/jose Class Usage Examples

Méthodes publiques

Méthode Description
add ( BigInteger $y ) : BigInteger Adds two BigIntegers.
compare ( BigInteger $y ) : integer Compares two numbers.
createFromBinaryString ( string $value ) : BigInteger
createFromDecimal ( integer $value ) : BigInteger
createFromDecimalString ( string $value ) : BigInteger
createFromGMPResource ( resource $value ) : BigInteger
mod ( BigInteger $d ) : BigInteger Performs modular exponentiation.
modInverse ( BigInteger $n ) : BigInteger Calculates modular inverses.
modPow ( BigInteger $e, BigInteger $n ) : BigInteger Performs modular exponentiation.
multiply ( BigInteger $x ) : BigInteger Multiplies two BigIntegers.
subtract ( BigInteger $y ) : BigInteger Subtracts two BigIntegers.
toBytes ( ) : string Converts a BigInteger to a binary string.

Private Methods

Méthode Description
__construct ( GMP | string $value, integer $base ) Converts base-10 and binary strings (base-256) to BigIntegers.

Method Details

add() public méthode

@param \Jose\Util\BigInteger $y
public add ( BigInteger $y ) : BigInteger
$y BigInteger
Résultat BigInteger

compare() public méthode

Compares two numbers.
public compare ( BigInteger $y ) : integer
$y BigInteger
Résultat integer < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal.

createFromBinaryString() public static méthode

public static createFromBinaryString ( string $value ) : BigInteger
$value string
Résultat BigInteger

createFromDecimal() public static méthode

public static createFromDecimal ( integer $value ) : BigInteger
$value integer
Résultat BigInteger

createFromDecimalString() public static méthode

public static createFromDecimalString ( string $value ) : BigInteger
$value string
Résultat BigInteger

createFromGMPResource() public static méthode

public static createFromGMPResource ( resource $value ) : BigInteger
$value resource
Résultat BigInteger

mod() public méthode

Performs modular exponentiation.
public mod ( BigInteger $d ) : BigInteger
$d BigInteger
Résultat BigInteger

modInverse() public méthode

Calculates modular inverses.
public modInverse ( BigInteger $n ) : BigInteger
$n BigInteger
Résultat BigInteger

modPow() public méthode

Performs modular exponentiation.
public modPow ( BigInteger $e, BigInteger $n ) : BigInteger
$e BigInteger
$n BigInteger
Résultat BigInteger

multiply() public méthode

Multiplies two BigIntegers.
public multiply ( BigInteger $x ) : BigInteger
$x BigInteger @return \Jose\Util\BigInteger
Résultat BigInteger

subtract() public méthode

@param \Jose\Util\BigInteger $y
public subtract ( BigInteger $y ) : BigInteger
$y BigInteger
Résultat BigInteger

toBytes() public méthode

Converts a BigInteger to a binary string.
public toBytes ( ) : string
Résultat string