ParagonIE_Sodium_Core_Util::chrToInt() public WP 1.0
Cache-timing-safe variant of ord()
{} Это метод класса: ParagonIE_Sodium_Core_Util{}
Хуков нет.
Возвращает
Число.
Использование
$result = ParagonIE_Sodium_Core_Util::chrToInt( $chr );
- $chr(строка) (обязательный)
- -
Код ParagonIE_Sodium_Core_Util::chrToInt() ParagonIE Sodium Core Util::chrToInt WP 5.6.2
public static function chrToInt($chr)
{
/* Type checks: */
if (!is_string($chr)) {
throw new TypeError('Argument 1 must be a string, ' . gettype($chr) . ' given.');
}
if (self::strlen($chr) !== 1) {
throw new SodiumException('chrToInt() expects a string that is exactly 1 character long');
}
/** @var array<int, int> $chunk */
$chunk = unpack('C', $chr);
return (int) ($chunk[1]);
}