我经常听到人们谈论“64进制编码”。它的用途是什么?
当前回答
从http://en.wikipedia.org/wiki/Base64
The term Base64 refers to a specific MIME content transfer encoding. It is also used as a generic term for any similar encoding scheme that encodes binary data by treating it numerically and translating it into a base 64 representation. The particular choice of base is due to the history of character set encoding: one can choose a set of 64 characters that is both part of the subset common to most encodings, and also printable. This combination leaves the data unlikely to be modified in transit through systems, such as email, which were traditionally not 8-bit clean. Base64 can be used in a variety of contexts: Evolution and Thunderbird use Base64 to obfuscate e-mail passwords[1] Base64 can be used to transmit and store text that might otherwise cause delimiter collision Base64 is often used as a quick but insecure shortcut to obscure secrets without incurring the overhead of cryptographic key management Spammers use Base64 to evade basic anti-spamming tools, which often do not decode Base64 and therefore cannot detect keywords in encoded messages. Base64 is used to encode character strings in LDIF files Base64 is sometimes used to embed binary data in an XML file, using a syntax similar to ...... e.g. Firefox's bookmarks.html. Base64 is also used when communicating with government Fiscal Signature printing devices (usually, over serial or parallel ports) to minimize the delay when transferring receipt characters for signing. Base64 is used to encode binary files such as images within scripts, to avoid depending on external files. Can be used to embed raw image data into a CSS property such as background-image.
其他回答
它基本上是一种用ASCII文本编码任意二进制数据的方法。每3个字节的数据需要4个字符,最后可能还会有一些填充。
基本上,输入的每6位都用64个字符的字母表进行编码。“标准”字母表使用a-z, a-z, 0-9和+和/,用=作为填充字符。有url安全的变体。
维基百科是一个相当好的信息来源。
它用于将任意二进制数据转换为ASCII文本。
例如,电子邮件附件就是通过这种方式发送的。
大多数情况下,我看到它被用于在只能处理ascii或简单字符集的上下文中对二进制数据进行编码。
Base64可以用于许多目的。
主要原因是将二进制数据转换为可通过的数据。
我有时用它来将JSON数据从一个站点传递到另一个站点,存储信息 在cookie中关于用户的信息。
注意: 你“可以”用它来加密——我不明白为什么人们说你不能,而且它不是加密,尽管它很容易被破解,而且不受欢迎。加密只不过是将一串数据转换为另一串数据,以后可以解密,也可以不解密,这就是base64所做的。
从http://en.wikipedia.org/wiki/Base64
The term Base64 refers to a specific MIME content transfer encoding. It is also used as a generic term for any similar encoding scheme that encodes binary data by treating it numerically and translating it into a base 64 representation. The particular choice of base is due to the history of character set encoding: one can choose a set of 64 characters that is both part of the subset common to most encodings, and also printable. This combination leaves the data unlikely to be modified in transit through systems, such as email, which were traditionally not 8-bit clean. Base64 can be used in a variety of contexts: Evolution and Thunderbird use Base64 to obfuscate e-mail passwords[1] Base64 can be used to transmit and store text that might otherwise cause delimiter collision Base64 is often used as a quick but insecure shortcut to obscure secrets without incurring the overhead of cryptographic key management Spammers use Base64 to evade basic anti-spamming tools, which often do not decode Base64 and therefore cannot detect keywords in encoded messages. Base64 is used to encode character strings in LDIF files Base64 is sometimes used to embed binary data in an XML file, using a syntax similar to ...... e.g. Firefox's bookmarks.html. Base64 is also used when communicating with government Fiscal Signature printing devices (usually, over serial or parallel ports) to minimize the delay when transferring receipt characters for signing. Base64 is used to encode binary files such as images within scripts, to avoid depending on external files. Can be used to embed raw image data into a CSS property such as background-image.
推荐文章
- 可能增加的最坏的空间使用量是多少?
- 为什么PHP的json_encode函数转换UTF-8字符串为十六进制实体?
- 我如何确定文件编码在OS X?
- Base64长度计算?
- “\d”在正则表达式中是数字吗?
- 使用Javascript的atob解码base64不能正确解码utf-8字符串
- 尝试将一个非属性列表对象设置为NSUserDefaults
- 如何将base64编码的映像保存到磁盘?
- 如何将Base64字符串转换为位图图像,以显示在一个ImageView?
- 用base64编码图像文件
- 如何在iOS上进行base64编码?
- URL方案/主机/路径中的“+”是否代表空格?
- HTML编码问题-显示“”字符而不是“ ”
- 在HTML中,我可以用✓做一个复选标记;. 有相应的x标记吗?
- 有人知道如何解码和编码Base64中的字符串使用Base64吗?