Can a base64 encoded string contain whitespace?

前端 未结 6 706
逝去的感伤
逝去的感伤 2020-12-10 23:48

Might a base64 encoded string contain whitespace? Specifically, could it contain whitespace at the end of the string?

PS. I\'m thinking about the whole \"My

6条回答
  •  既然无缘
    2020-12-11 00:20

    Wikipedia suggests that there're like a gazillion variations of the Base64 encoding:

    http://en.wikipedia.org/wiki/Base64

    So the answer probably depends on what you need to do with the string. But I'd dare say you created in PHP with base64_encode() so it appears to be safe to append blanks:

    
    

提交回复
热议问题