possible characters base64 url safe function

前端 未结 2 1423
无人及你
无人及你 2020-12-17 09:11

What is the range of possible characters returned from this string?

function base64url_encode($data) 
{ 
  return rtrim(strtr(base64_encode($data), \'+/\', \         


        
2条回答
  •  情话喂你
    2020-12-17 09:34

    Base64 encoded strings may contain the characters 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 - _

    More Info

提交回复
热议问题