ParagonIE_Sodium_Compat::bin2hex

Advertisement

Summery Summery

Cache-timing-safe implementation of bin2hex().

Syntax Syntax

ParagonIE_Sodium_Compat::bin2hex( string $string )

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);
    }

Advertisement

Advertisement

Leave a Reply