ParagonIE_Sodium_Core_Util::numericTo64BitInteger() – Convert any arbitrary numbers into two 32-bit integers that represent a 64-bit integer.

You appear to be a bot. Output may be restricted

Description

Convert any arbitrary numbers into two 32-bit integers that represent a 64-bit integer.

Usage

$array

Parameters

$num
( int|float ) required -

Returns

array int>

Source

File name: wordpress/wp-includes/sodium_compat/src/Core/Util.php


Lines:

1 to 25 of 25
    public static function numericTo64BitInteger($num)
    {
        $high = 0;
        
/** @var int $low */
        if (PHP_INT_SIZE === 4) {
            $low = (int) $num;
        } else {
            $low = $num & 0xffffffff;
        }

        if ((+(abs($num))) >= 1) {
            if ($num > 0) {
                
/** @var int $high */
                $high = min((+(floor($num/4294967296))), 4294967295);
            } else {
                
/** @var int $high */
                $high = ~~((+(ceil(($num - (+((~~($num)))))/4294967296))));
            }
        }
        return array((int) $high, (int) $low);
    }
 

 View on GitHub View on Trac