ParagonIE_Sodium_Core_Util::numericTo64BitInteger

Advertisement

Summery Summery

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

Syntax Syntax

ParagonIE_Sodium_Core_Util::numericTo64BitInteger( int|float $num )

Parameters Parameters

$num

(int|float) (Required)

Return Return

(array<int,) int>

Source Source

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

    public static function numericTo64BitInteger($num)
    {
        $high = 0;
        /** @var int $low */
        $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);
    }

Advertisement

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.