Base64
![本页使用了标题或全文手工转换](https://upload.wikimedia.org/wikipedia/commons/thumb/c/cd/Zh_conversion_icon_m.svg/35px-Zh_conversion_icon_m.svg.png)
Base64(A-Z
、a-z
、0-9
,这样
Base64
0 | 000000 | A | 16 | 010000 | Q | 32 | 100000 | g | 48 | 110000 | w | |||
1 | 000001 | B | 17 | 010001 | R | 33 | 100001 | h | 49 | 110001 | x | |||
2 | 000010 | C | 18 | 010010 | S | 34 | 100010 | i | 50 | 110010 | y | |||
3 | 000011 | D | 19 | 010011 | T | 35 | 100011 | j | 51 | 110011 | z | |||
4 | 000100 | E | 20 | 010100 | U | 36 | 100100 | k | 52 | 110100 | 0 | |||
5 | 000101 | F | 21 | 010101 | V | 37 | 100101 | l | 53 | 110101 | 1 | |||
6 | 000110 | G | 22 | 010110 | W | 38 | 100110 | m | 54 | 110110 | 2 | |||
7 | 000111 | H | 23 | 010111 | X | 39 | 100111 | n | 55 | 110111 | 3 | |||
8 | 001000 | I | 24 | 011000 | Y | 40 | 101000 | o | 56 | 111000 | 4 | |||
9 | 001001 | J | 25 | 011001 | Z | 41 | 101001 | p | 57 | 111001 | 5 | |||
10 | 001010 | K | 26 | 011010 | a | 42 | 101010 | q | 58 | 111010 | 6 | |||
11 | 001011 | L | 27 | 011011 | b | 43 | 101011 | r | 59 | 111011 | 7 | |||
12 | 001100 | M | 28 | 011100 | c | 44 | 101100 | s | 60 | 111100 | 8 | |||
13 | 001101 | N | 29 | 011101 | d | 45 | 101101 | t | 61 | 111101 | 9 | |||
14 | 001110 | O | 30 | 011110 | e | 46 | 101110 | u | 62 | 111110 | + | |||
15 | 001111 | P | 31 | 011111 | f | 47 | 101111 | v | 63 | 111111 | / | |||
= |
示 例
[编辑]Man is distinguished, not only by his reason, but by this singular passion from other animals, which is a lust of the mind, that by a perseverance of delight in the continued and indefatigable generation of knowledge, exceeds the short vehemence of any carnal pleasure.
TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4=
编码「Man」TWFu
,
M | a | n | ||||||||||||||||||||||
ASCII编码 | 77 | 97 | 110 | |||||||||||||||||||||
0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | |
19 | 22 | 5 | 46 | |||||||||||||||||||||
Base64编码 | T | W | F | u |
如果=
A | ||||||||||||||||||||||||
0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | |||||||||||||
0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | |||||||||||||
Base64编码 | Q | Q | = | = | ||||||||||||||||||||
B | C | |||||||||||||||||||||||
0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | |||||||
0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | |||||||
Base64编码 | Q | k | M | = |
应用
[编辑]变种
[编辑]base64编码对应+
)、63/
)=
),
编码 | 编码 |
换行 |
|||||
---|---|---|---|---|---|---|---|
RFC 1421: |
+ |
/ |
= |
CR+LF | 64, |
||
RFC 2045: |
+ |
/ |
= |
CR+LF | 弃用 | ||
RFC 2152: |
+ |
/ |
|||||
RFC 3501: |
+ |
, |
|||||
RFC 4648 §4:标准base64 | + |
/ |
= |
||||
RFC 4648 §5:base64url(URL |
- |
_ |
= |
||||
RFC 4880: |
+ |
/ |
= |
CR+LF | Radix-64编码24 |
MIME
[编辑]+
/
,=
转换ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/
=
;=
。
IRCu
[编辑]+/
[]
。
UTF-7
[编辑]UTF-7=
补餘,
标准
URL
[编辑]Base64编码
/
+
%XX
%
%
为解决此问题,=
+
/
-
_
,这样就免
另有+
/
!
-
,+
,*
以及[
]
此外还有+/
_-
._
(.-
(_:
(
其他
[编辑]相 关事件
[编辑]- 2018
年 2月 电子邮件程 序 Exim 发现重大 漏 洞 ,编号为 CVE-2018-6789 (页面存 档备份,存 于互联网档案 馆)的 緩衝 區 溢位漏 洞 允 许攻击者在 服 务器上 远程执行恶意代 码。漏 洞 位 于 base64解 码函数 中 ,影 响 Exim v4.90.1之 前 的 所有 版本 ,多 达 40 万服务器受到影响。[1][2]
参 见
[编辑]参考 资料
[编辑]外部 链接
[编辑]- RFC 1421(Privacy Enhancement for Electronic Internet Mail)
- RFC 2045(MIME)
- RFC 3548(The Base16, Base32, and Base64 Data Encodings)
在 RFC 4648中 被 替 代 - Online Base64 Encoding (页面
存 档备份,存 于互联网档案 馆) - Online Base64 Decoding (页面
存 档备份,存 于互联网档案 馆) 在 线Base64编码 (页面存 档备份,存 于互联网档案 馆)在 线Base64解 码 (页面存 档备份,存 于互联网档案 馆)
|