mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-02-05 13:28:27 +00:00
Merge branch '3.0'
This commit is contained in:
commit
f6bf4471d9
@ -435,7 +435,7 @@ abstract class Strings
|
||||
// return str_replace(['+', '/'], ['-', '_'], self::base64_encode($data));
|
||||
|
||||
return function_exists('sodium_bin2base64') ?
|
||||
sodium_bin2base64($data, SODIUM_BASE64_VARIANT_URLSAFE) :
|
||||
sodium_bin2base64($data, SODIUM_BASE64_VARIANT_URLSAFE_NO_PADDING) :
|
||||
Base64UrlSafe::encode($data);
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ abstract class IEEE
|
||||
{
|
||||
$r = $r->toBytes();
|
||||
$s = $s->toBytes();
|
||||
$length >>= 3;
|
||||
$length = (int) ceil($length / 8);
|
||||
return str_pad($r, $length, "\0", STR_PAD_LEFT) . str_pad($s, $length, "\0", STR_PAD_LEFT);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user