Can a base64 encoded string contain whitespace?

前端 未结 6 734
逝去的感伤
逝去的感伤 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:33

    As far as I know it cannot. Basically a Base64 string must be constructed from a set of 64 characters. A-Z, a-z, 0-9 make 62 - the other two depend on the implementation.

    Based on what I know, there is now implementation that will use white space as a character. Main reason for that is readability - i.e. a Base64 string must be easily printed and recognized.

    You'd probably find more info about it on Wikipedia.

提交回复
热议问题