1
0
mirror of https://github.com/delight-im/PHP-Auth.git synced 2025-08-02 14:17:26 +02:00

Swap positions of hyphen and underscore characters in URL-safe Base64

This ensures compatibility with RFC 4648 and the example from the
appendix of RFC 7515, aside from the padding character that is used.
This commit is contained in:
Marco
2017-07-23 23:18:28 +02:00
parent 01a52b76bc
commit 854bc2b62b

View File

@@ -11,7 +11,7 @@ namespace Delight\Auth;
final class Base64 {
const SPECIAL_CHARS_ORIGINAL = '+/=';
const SPECIAL_CHARS_SAFE = '_-~';
const SPECIAL_CHARS_SAFE = '-_~';
public static function encode($data, $safeChars = false) {
$result = base64_encode($data);