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;
}
}
/** * Decode the given integer. * * @param int $value * * @return int */ public function decode($value) { return $this->obfuscator->decode($value); }