WordPress at Your Fingertips
function is not described

ParagonIE_Sodium_Core32_Int64::shiftRight() public WP 1.0

{} It's a method of the class: ParagonIE_Sodium_Core32_Int64{}

No Hooks.

Return

ParagonIE_Sodium_Core32_Int64.

Usage

$ParagonIE_Sodium_Core32_Int64 = new ParagonIE_Sodium_Core32_Int64();
$ParagonIE_Sodium_Core32_Int64->shiftRight( $c );
$c(int)
-

Code of ParagonIE_Sodium_Core32_Int64::shiftRight() WP 5.8.2

public function shiftRight($c = 0)
{
    ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1);
    $c = (int) $c;
    /** @var int $c */
    $return = new ParagonIE_Sodium_Core32_Int64();
    $return->unsignedInt = $this->unsignedInt;
    $c &= 63;

    $negative = -(($this->limbs[0] >> 15) & 1);
    if ($c >= 16) {
        if ($c >= 48) {
            $return->limbs = array(
                (int) ($negative & 0xffff),
                (int) ($negative & 0xffff),
                (int) ($negative & 0xffff),
                (int) $this->limbs[0]
            );
        } elseif ($c >= 32) {
            $return->limbs = array(
                (int) ($negative & 0xffff),
                (int) ($negative & 0xffff),
                (int) $this->limbs[0],
                (int) $this->limbs[1]
            );
        } else {
            $return->limbs = array(
                (int) ($negative & 0xffff),
                (int) $this->limbs[0],
                (int) $this->limbs[1],
                (int) $this->limbs[2]
            );
        }
        return $return->shiftRight($c & 15);
    }

    if ($c === 0) {
        $return->limbs = $this->limbs;
    } elseif ($c < 0) {
        return $this->shiftLeft(-$c);
    } else {
        if (!is_int($c)) {
            throw new TypeError();
        }
        /** @var int $carryRight */
        $carryRight = ($negative & 0xffff);
        $mask = (int) (((1 << ($c + 1)) - 1) & 0xffff);
        for ($i = 0; $i < 4; ++$i) {
            $return->limbs[$i] = (int) (
                (($this->limbs[$i] >> $c) | ($carryRight << (16 - $c))) & 0xffff
            );
            $carryRight = (int) ($this->limbs[$i] & $mask);
        }
    }
    return $return;
}