Jenssegers\Optimus\Optimus::decode PHP Method

decode() public method

Decode an integer.
public decode ( integer $value ) : integer
$value integer
return integer
    public function decode($value)
    {
        if (!is_numeric($value)) {
            throw new InvalidArgumentException('Argument should be an integer');
        }
        switch (static::$mode) {
            case static::MODE_GMP:
                return gmp_intval(gmp_mul((int) $value ^ $this->xor, $this->inverse)) & static::MAX_INT;
            default:
                return ((int) $value ^ $this->xor) * $this->inverse & static::MAX_INT;
        }
    }

Usage Example

Example #1
0
 /**
  * Decode the given integer.
  *
  * @param int $value
  *
  * @return int
  */
 public function decode($value)
 {
     return $this->obfuscator->decode($value);
 }
All Usage Examples Of Jenssegers\Optimus\Optimus::decode