public static function ParagonIE_Sodium_Core_Util::store_4 in Automatic Updates 7
Same name and namespace in other branches
- 8 vendor/paragonie/sodium_compat/src/Core/Util.php \ParagonIE_Sodium_Core_Util::store_4()
Store a 32-bit integer into a string, treating it as big-endian.
@internal You should not use this directly from another application
Parameters
int $int:
Return value
string
Throws
TypeError
File
- vendor/
paragonie/ sodium_compat/ src/ Core/ Util.php, line 671
Class
- ParagonIE_Sodium_Core_Util
- Class ParagonIE_Sodium_Core_Util
Code
public static function store_4($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('N', $int);
return $packed;
}