From cedcf84ccc152b8f456720912e15d151990d391b Mon Sep 17 00:00:00 2001 From: smiley Date: Thu, 7 Mar 2024 00:42:22 +0100 Subject: [PATCH] :shower: --- src/Common/Base64.php | 4 ++-- src/Common/Hex.php | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Common/Base64.php b/src/Common/Base64.php index 67feb8c..f633e3f 100644 --- a/src/Common/Base64.php +++ b/src/Common/Base64.php @@ -37,7 +37,7 @@ class Base64{ public static function encode(#[SensitiveParameter] string $str):string{ if(function_exists('sodium_bin2base64')){ - return sodium_bin2base64($str, \SODIUM_BASE64_VARIANT_ORIGINAL); + return \sodium_bin2base64($str, \SODIUM_BASE64_VARIANT_ORIGINAL); } return ConstantTimeBase64::encode($str); @@ -50,7 +50,7 @@ public static function decode(#[SensitiveParameter] string $base64):string{ self::checkCharacterSet($base64); if(function_exists('sodium_base642bin')){ - return sodium_base642bin($base64, \SODIUM_BASE64_VARIANT_ORIGINAL); + return \sodium_base642bin($base64, \SODIUM_BASE64_VARIANT_ORIGINAL); } return ConstantTimeBase64::decode($base64); diff --git a/src/Common/Hex.php b/src/Common/Hex.php index b768517..966f47c 100644 --- a/src/Common/Hex.php +++ b/src/Common/Hex.php @@ -28,21 +28,21 @@ class Hex{ public const CHARSET = '1234567890ABCDEFabcdef'; /** - * Encode a raw-binary to hexadecimal + * Encode a string to hexadecimal * * @codeCoverageIgnore */ public static function encode(#[SensitiveParameter] string $str):string{ if(function_exists('sodium_bin2hex')){ - return sodium_bin2hex($str); + return \sodium_bin2hex($str); } return ConstantTimeHex::encode($str); } /** - * Decode a raw-binary string from hexadecimal + * Decode a string from hexadecimal * * @codeCoverageIgnore */ @@ -50,7 +50,7 @@ public static function decode(#[SensitiveParameter] string $hex):string{ self::checkCharacterSet($hex); if(function_exists('sodium_hex2bin')){ - return sodium_hex2bin($hex); + return \sodium_hex2bin($hex); } return ConstantTimeHex::decode($hex);