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 @@ -37,7 +37,7 @@ class Base64{
37
37
public static function encode (#[SensitiveParameter] string $ str ):string {
38
38
39
39
if (function_exists ('sodium_bin2base64 ' )){
40
- return sodium_bin2base64 ($ str , \SODIUM_BASE64_VARIANT_ORIGINAL );
40
+ return \ sodium_bin2base64 ($ str , \SODIUM_BASE64_VARIANT_ORIGINAL );
41
41
}
42
42
43
43
return ConstantTimeBase64::encode ($ str );
@@ -50,7 +50,7 @@ public static function decode(#[SensitiveParameter] string $base64):string{
50
50
self ::checkCharacterSet ($ base64 );
51
51
52
52
if (function_exists ('sodium_base642bin ' )){
53
- return sodium_base642bin ($ base64 , \SODIUM_BASE64_VARIANT_ORIGINAL );
53
+ return \ sodium_base642bin ($ base64 , \SODIUM_BASE64_VARIANT_ORIGINAL );
54
54
}
55
55
56
56
return ConstantTimeBase64::decode ($ base64 );
Original file line number Diff line number Diff line change @@ -28,29 +28,29 @@ class Hex{
28
28
public const CHARSET = '1234567890ABCDEFabcdef ' ;
29
29
30
30
/**
31
- * Encode a raw-binary to hexadecimal
31
+ * Encode a string to hexadecimal
32
32
*
33
33
* @codeCoverageIgnore
34
34
*/
35
35
public static function encode (#[SensitiveParameter] string $ str ):string {
36
36
37
37
if (function_exists ('sodium_bin2hex ' )){
38
- return sodium_bin2hex ($ str );
38
+ return \ sodium_bin2hex ($ str );
39
39
}
40
40
41
41
return ConstantTimeHex::encode ($ str );
42
42
}
43
43
44
44
/**
45
- * Decode a raw-binary string from hexadecimal
45
+ * Decode a string from hexadecimal
46
46
*
47
47
* @codeCoverageIgnore
48
48
*/
49
49
public static function decode (#[SensitiveParameter] string $ hex ):string {
50
50
self ::checkCharacterSet ($ hex );
51
51
52
52
if (function_exists ('sodium_hex2bin ' )){
53
- return sodium_hex2bin ($ hex );
53
+ return \ sodium_hex2bin ($ hex );
54
54
}
55
55
56
56
return ConstantTimeHex::decode ($ hex );
You can’t perform that action at this time.
0 commit comments