WordPress at Your Fingertips
function is not described

ParagonIE_Sodium_Core_Util::store64_le() public WP 1.0

Stores a 64-bit integer as an string, treating it as little-endian.

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

No Hooks.

Return

String.

Usage

$result = ParagonIE_Sodium_Core_Util::store64_le( $int );
$int(int) (required)
-

Code of ParagonIE_Sodium_Core_Util::store64_le() WP 5.8.2

public static function store64_le($int)
{
    /* Type checks: */
    if (!is_int($int)) {
        if (is_numeric($int)) {
            $int = (int) $int;
        } else {
            throw new TypeError('Argument 1 must be an integer, ' . gettype($int) . ' given.');
        }
    }

    if (PHP_INT_SIZE === 8) {
        if (PHP_VERSION_ID >= 50603) {
            /** @var string $packed */
            $packed = pack('P', $int);
            return $packed;
        }
        return self::intToChr($int & 0xff) .
            self::intToChr(($int >>  8) & 0xff) .
            self::intToChr(($int >> 16) & 0xff) .
            self::intToChr(($int >> 24) & 0xff) .
            self::intToChr(($int >> 32) & 0xff) .
            self::intToChr(($int >> 40) & 0xff) .
            self::intToChr(($int >> 48) & 0xff) .
            self::intToChr(($int >> 56) & 0xff);
    }
    if ($int > PHP_INT_MAX) {
        list($hiB, $int) = self::numericTo64BitInteger($int);
    } else {
        $hiB = 0;
    }
    return
        self::intToChr(($int      ) & 0xff) .
        self::intToChr(($int >>  8) & 0xff) .
        self::intToChr(($int >> 16) & 0xff) .
        self::intToChr(($int >> 24) & 0xff) .
        self::intToChr($hiB & 0xff) .
        self::intToChr(($hiB >>  8) & 0xff) .
        self::intToChr(($hiB >> 16) & 0xff) .
        self::intToChr(($hiB >> 24) & 0xff);
}