ParagonIE_Sodium_Core32_Int32::compareInt

Advertisement

Syntax Syntax

ParagonIE_Sodium_Core32_Int32::compareInt( int $b )

Parameters Parameters

$b

(Required)

Return Return

(int)

Source Source

File: wp-includes/sodium_compat/src/Core32/Int32.php

    public function compareInt($b = 0)
    {
        $gt = 0;
        $eq = 1;

        $i = 2;
        $j = 0;
        while ($i > 0) {
            --$i;
            /** @var int $x1 */
            $x1 = $this->limbs[$i];
            /** @var int $x2 */
            $x2 = ($b >> ($j << 4)) & 0xffff;
            /** @var int $gt */
            $gt |= (($x2 - $x1) >> 8) & $eq;
            /** @var int $eq */
            $eq &= (($x2 ^ $x1) - 1) >> 8;
        }
        return ($gt + $gt - $eq) + 1;
    }

Advertisement

Advertisement

Leave a Reply