compare() public method

Compares two numbers.
public compare ( BigInteger $y ) : integer
$y BigInteger
return integer < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal.
Beispiel #1
0
 /**
  * RSAVP1.
  *
  * @param \Jose\KeyConverter\RSAKey $key
  * @param \Jose\Util\BigInteger     $s
  *
  * @return \Jose\Util\BigInteger|false
  */
 private static function getRSAVP1(RSAKey $key, BigInteger $s)
 {
     if ($s->compare(BigInteger::createFromDecimal(0)) < 0 || $s->compare($key->getModulus()) > 0) {
         return false;
     }
     return self::exponentiate($key, $s);
 }