ParagonIE_Sodium_Core_Util::store32_le

Advertisement

Summery Summery

Store a 32-bit integer into a string, treating it as little-endian.

Syntax Syntax

ParagonIE_Sodium_Core_Util::store32_le( int $int )

Parameters Parameters

$int

(Required)

Return Return

(string)

Source Source

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

    public static function store32_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.');
            }
        }

        /** @var string $packed */
        $packed = pack('V', $int);
        return $packed;
    }

Advertisement

Advertisement

Leave a Reply