What is base64 encoding used for?

后端 未结 18 1019
滥情空心
滥情空心 2020-11-22 09:45

I\'ve heard people talking about \"base 64 encoding\" here and there. What is it used for?

18条回答
  •  北恋
    北恋 (楼主)
    2020-11-22 09:55

    It's basically a way of encoding arbitrary binary data in ASCII text. It takes 4 characters per 3 bytes of data, plus potentially a bit of padding at the end.

    Essentially each 6 bits of the input is encoded in a 64-character alphabet. The "standard" alphabet uses A-Z, a-z, 0-9 and + and /, with = as a padding character. There are URL-safe variants.

    Wikipedia is a reasonably good source of more information.

提交回复
热议问题