ParagonIE_Sodium_Compat::hex2bin() public WP 1.0
Cache-timing-safe implementation of hex2bin().
{} It's a method of the class: ParagonIE_Sodium_Compat{}
No Hooks.
Return
String
. Raw binary string
Usage
$result = ParagonIE_Sodium_Compat::hex2bin( $string );
- $string(string) (required)
- Hexadecimal string
Code of ParagonIE_Sodium_Compat::hex2bin() ParagonIE Sodium Compat::hex2bin WP 5.7
public static function hex2bin($string)
{
/* Type checks: */
ParagonIE_Sodium_Core_Util::declareScalarType($string, 'string', 1);
if (self::useNewSodiumAPI()) {
if (is_callable('sodium_hex2bin')) {
return (string) sodium_hex2bin($string);
}
}
if (self::use_fallback('hex2bin')) {
return (string) call_user_func('\\Sodium\\hex2bin', $string);
}
return ParagonIE_Sodium_Core_Util::hex2bin($string);
}