File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ class Base64{
3636 public static function encode (string $ str ):string {
3737
3838 if (function_exists ('sodium_bin2base64 ' )){
39- return sodium_bin2base64 ($ str , \SODIUM_BASE64_VARIANT_ORIGINAL );
39+ return \ sodium_bin2base64 ($ str , \SODIUM_BASE64_VARIANT_ORIGINAL );
4040 }
4141
4242 return ConstantTimeBase64::encode ($ str );
@@ -49,7 +49,7 @@ public static function decode(string $base64):string{
4949 self ::checkCharacterSet ($ base64 );
5050
5151 if (function_exists ('sodium_base642bin ' )){
52- return sodium_base642bin ($ base64 , \SODIUM_BASE64_VARIANT_ORIGINAL );
52+ return \ sodium_base642bin ($ base64 , \SODIUM_BASE64_VARIANT_ORIGINAL );
5353 }
5454
5555 return ConstantTimeBase64::decode ($ base64 );
Original file line number Diff line number Diff line change @@ -27,29 +27,29 @@ class Hex{
2727 public const CHARSET = '1234567890ABCDEFabcdef ' ;
2828
2929 /**
30- * Encode a raw-binary to hexadecimal
30+ * Encode a string to hexadecimal
3131 *
3232 * @codeCoverageIgnore
3333 */
3434 public static function encode (string $ str ):string {
3535
3636 if (function_exists ('sodium_bin2hex ' )){
37- return sodium_bin2hex ($ str );
37+ return \ sodium_bin2hex ($ str );
3838 }
3939
4040 return ConstantTimeHex::encode ($ str );
4141 }
4242
4343 /**
44- * Decode a raw-binary string from hexadecimal
44+ * Decode a string from hexadecimal
4545 *
4646 * @codeCoverageIgnore
4747 */
4848 public static function decode (string $ hex ):string {
4949 self ::checkCharacterSet ($ hex );
5050
5151 if (function_exists ('sodium_hex2bin ' )){
52- return sodium_hex2bin ($ hex );
52+ return \ sodium_hex2bin ($ hex );
5353 }
5454
5555 return ConstantTimeHex::decode ($ hex );
You can’t perform that action at this time.
0 commit comments