什么是基地64编码使用? [英] What is base 64 encoding used for?

查看:203
本文介绍了什么是基地64编码使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我听到人们在谈论基地64编码在这里和那里。它使用的是什么?

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

推荐答案

当您有想通过网络运送一些二进制数据,通常不要只是流的比特和字节在导线做原始格式。为什么?因为有的媒体是为流文本的。你永远不知道 - 某些协议可能跨preT的二进制数据作为控制字符(如调制解调器),或者你的二进制数据可能会因为底层协议可能会认为你已经进入了一个特殊的字符组合搞砸了(如FTP如何转换行结束)。

When you have some binary data that you want to ship across a network, you generally don't do it by just streaming the bits and bytes over the wire in a raw format. Why? because some media are made for streaming text. You never know -- some protocols may interpret your binary data as control characters (like a modem), or your binary data could be screwed up because the underlying protocol might think that you've entered a special character combination (like how FTP translates line endings).

因此​​,要解决这个问题,人们EN code中的二进制数据转换成字符。 Base64是这些类型的编码中的一个。为什么64?因为你通常可以依赖于相同的64个字符是在许多字符集present,你可以合理确信您的数据的最终将会在电线两袖清风的另一端。

So to get around this, people encode the binary data into characters. Base64 is one of these types of encodings. Why 64? Because you can generally rely on the same 64 characters being present in many character sets, and you can be reasonably confident that your data's going to end up on the other side of the wire uncorrupted.

这篇关于什么是基地64编码使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆