What is the range of possible characters returned from this string?
function base64url_encode($data) { return rtrim(strtr(base64_encode($data), \'+/\', \
Base64 encoded strings may contain the characters a-z A-Z 0-9 + / =.
a-z A-Z 0-9 + / =
You're removing the right-padding = and replacing + with - and / with _.
=
+
-
/
_
So in your case, yes, the possible characters are a-z A-Z 0-9 - _
a-z A-Z 0-9 - _
More Info