What is the advantage of using Base64 encoding?

后端 未结 8 1550
长情又很酷
长情又很酷 2020-12-13 13:18

What is the advantage of using Base64 encode?

I would like to understand it better. Do I really need it? Can\'t I simply use pure strings?

I heard that the e

8条回答
  •  旧巷少年郎
    2020-12-13 14:02

    The advantages of Base64 encode, like somebody said, are available to transmit data from binary, into (most commonly) ASCII characters. Due to the likeliness that the receiving end can handle ASCII, it makes it a nice way to transfer binary data, via a text stream.

    If your situation can handle native binary data, that will most likely yield better results, in terms of speed and such, but if not, Base64 is most likely the way to go. JSON is a great example of when you would benefit from something like this, or when it needs to be stored in a text field somewhere. Give us some more details and we can provide a better tailored answer.

提交回复
热议问题