ParagonIE_Sodium_Core32_Int64::compareInt

Advertisement

Syntax Syntax

ParagonIE_Sodium_Core32_Int64::compareInt( int $b )

Parameters Parameters

$b

(Required)

Return Return

(int)

Source Source

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

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

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

Advertisement

Advertisement

Leave a Reply