Skip to content

Commit cedcf84

Browse files
committed
🚿
1 parent dfaef9f commit cedcf84

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Common/Base64.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Base64{
3737
public static function encode(#[SensitiveParameter] string $str):string{
3838

3939
if(function_exists('sodium_bin2base64')){
40-
return sodium_bin2base64($str, \SODIUM_BASE64_VARIANT_ORIGINAL);
40+
return \sodium_bin2base64($str, \SODIUM_BASE64_VARIANT_ORIGINAL);
4141
}
4242

4343
return ConstantTimeBase64::encode($str);
@@ -50,7 +50,7 @@ public static function decode(#[SensitiveParameter] string $base64):string{
5050
self::checkCharacterSet($base64);
5151

5252
if(function_exists('sodium_base642bin')){
53-
return sodium_base642bin($base64, \SODIUM_BASE64_VARIANT_ORIGINAL);
53+
return \sodium_base642bin($base64, \SODIUM_BASE64_VARIANT_ORIGINAL);
5454
}
5555

5656
return ConstantTimeBase64::decode($base64);

src/Common/Hex.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,29 @@ class Hex{
2828
public const CHARSET = '1234567890ABCDEFabcdef';
2929

3030
/**
31-
* Encode a raw-binary to hexadecimal
31+
* Encode a string to hexadecimal
3232
*
3333
* @codeCoverageIgnore
3434
*/
3535
public static function encode(#[SensitiveParameter] string $str):string{
3636

3737
if(function_exists('sodium_bin2hex')){
38-
return sodium_bin2hex($str);
38+
return \sodium_bin2hex($str);
3939
}
4040

4141
return ConstantTimeHex::encode($str);
4242
}
4343

4444
/**
45-
* Decode a raw-binary string from hexadecimal
45+
* Decode a string from hexadecimal
4646
*
4747
* @codeCoverageIgnore
4848
*/
4949
public static function decode(#[SensitiveParameter] string $hex):string{
5050
self::checkCharacterSet($hex);
5151

5252
if(function_exists('sodium_hex2bin')){
53-
return sodium_hex2bin($hex);
53+
return \sodium_hex2bin($hex);
5454
}
5555

5656
return ConstantTimeHex::decode($hex);

0 commit comments

Comments
 (0)