Summery Summery
Cache-timing-safe implementation of bin2hex().
Syntax Syntax
Parameters Parameters
- $string
-
(Required) A string (probably raw binary)
Return Return
(string) A hexadecimal-encoded string
Source Source
File: wp-includes/sodium_compat/src/Compat.php
public static function bin2hex($string)
{
/* Type checks: */
ParagonIE_Sodium_Core_Util::declareScalarType($string, 'string', 1);
if (self::useNewSodiumAPI()) {
return (string) sodium_bin2hex($string);
}
if (self::use_fallback('bin2hex')) {
return (string) call_user_func('\\Sodium\\bin2hex', $string);
}
return ParagonIE_Sodium_Core_Util::bin2hex($string);
}