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

Switch characters in URL-safe Base64 to use tilde (~) for padding

The tilde character is less familiar to most users and harder to type
on most keyboards (compared to the hyphen and underscore characters).
This commit is contained in:
Marco
2017-07-23 22:56:28 +02:00
parent ad88c1c6ab
commit 01a52b76bc

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);