早起眼皮肿是什么原因引起的| 2012年是什么年| 卖酒需要办理什么证| 闹心是什么意思啊| 28岁今年属什么| 什么叫无氧运动| 5月9号是什么星座| 网络拒绝接入什么意思| 国民党为什么会失败| 老是拉肚子什么原因| 老人脚肿是什么原因引起的| 五体投地是什么意思| 玄学是什么意思| 洲际导弹是什么意思| 左眼皮跳是什么预兆呢| 呼吁是什么意思| 下肢静脉血栓吃什么药| 卅什么意思| 痔疮是什么样子| 五心烦热吃什么药| 南瓜不能和什么同吃| s925银是什么意思| 精力是什么意思| 昙花一现什么意思| 红茶加枸杞有什么功效| 女性婚检都检查什么| rr是什么意思| 梦游为什么不能叫醒| 什么人始终不敢洗澡| 动物园里面有什么动物| 结婚十一年是什么婚| 腿发麻是什么原因| 青鹏软膏主要治疗什么| 酒精和碘伏有什么区别| 钱丢了预示着什么| 豆包是什么意思| 1015是什么星座| 屏幕总成带框和不带框有什么区别| 曌是什么意思| 吃什么东西能流产| 濑粉是什么| 青黛色是什么颜色| 什么品牌的假发好| 孩子出疹子应该注意什么| pu是什么元素| 什么的娃娃| 高血压1级是什么意思| 担担面是什么面| 什么是官方旗舰店| 胃炎吃什么药好| 耳鸣脑鸣是什么原因引起的| 北京属于什么方向| 作息时间是什么意思| 乳腺瘤是什么引起的| 这是什么呀| 白茶有什么功效| 水烟是什么| 梦见输钱是什么预兆| 暴殄天物是什么生肖| 姓薄的读音是什么| 血糖高什么不能吃| 怀孕肚皮痒是什么原因| 什么运动可以让孩子长高| 1993年属什么| 我好想你是什么歌| 嬛嬛一袅楚宫腰什么意思| 蔷薇色是什么颜色| 小孩子流鼻血是什么原因| 什么人适合吃蛋白质粉| 福禄寿什么意思| 怀孕两个星期有什么反应| 艾滋病是什么| 什么车不能开| 哺乳期可以吃什么消炎药| 宫殿是什么意思| 薛定谔的猫比喻什么| 无花果什么时候结果| 皓石是什么| 腊月是什么星座| 猪脚煲汤放什么材料好| 艮五行属什么| 肌腱属于什么组织| 蝉联是什么意思| 待字闺中什么意思| 束缚的意思是什么| 水落石出开过什么生肖| 肠绞痛什么原因引起的| 银饰为什么会变黑| 新生儿痤疮是什么引起的| 乙肝表面抗体阳性是什么意思| 沪深300是什么意思| 避孕套上的油是什么油| 母亲节送妈妈什么好| 梦见孩子丢了是什么意思| 家里飞蛾多是什么原因| 左是什么意思| 人生于世上有几个知己是什么歌| 七夕节是什么时候| 有什么办法| 山楂片泡水喝有什么好处| 结膜炎什么症状| 什么的雪花| 男生喉结不明显是为什么| 胃烧吃什么药| 胆固醇高是什么原因| 尿次数多是什么原因| 眼睛充血是什么原因造成的| 打点滴是什么意思| 股票pb是什么意思| 山楂泡水有什么好处| 经常吃南瓜有什么好处和坏处| 蜂蜜跟什么不能一起吃| 焦虑症吃什么药好| 吃什么补肾壮阳最快| 乳腺结节不能吃什么食物| 血糖和尿糖有什么区别| 杭州灵隐寺求什么最灵| 为什么打嗝不停| ur是什么品牌| 左肾结石的症状是什么| 梦见别人生孩子预示什么| 高专是什么| 唐朝什么时候灭亡的| 萎缩性胃炎是什么原因引起的| agc什么意思| ve是什么意思| classy是什么意思| 弱阳性和阳性有什么区别| 胆摘除对身体有什么影响| 什么是蛋白质| 二级b超是检查什么| 白细胞少了会得什么病| 戴玉手镯有什么好处| 猪笼入水是什么意思| 血管很明显是什么原因| 血清胃功能检测是什么| 打火机里面的液体是什么| 西瓜吃了有什么好处| 查染色体挂什么科| 二拇指比大拇指长代表什么| 细菌感染用什么药| 一月二十五号是什么星座| 葛根是什么东西| 落花生的落是什么意思| 血脂高是什么意思| 心梗是什么病| 什么食物含铅| 合疗和医保有什么区别| 做梦梦到拉屎是什么意思| 脑梗的前兆是什么| 优五行属性是什么| 抽烟对女生有什么危害| 脚板心发热是什么原因| 什么样的笑容| 志五行属什么| 连城诀为什么不火| 白细胞酯酶弱阳性是什么意思| 龙头凤尾是什么生肖| 恢复是什么意思| 肠胃不好适合喝什么茶| 滚球是什么意思| m代表什么意思| 四点底和什么有关| 广东菜心是什么菜| 美育是什么意思| 总钙偏高是什么原因| 6.15是什么星座| 喝什么对嗓子好| 女人梦见蛇预示着什么| 螨虫什么样子| 乳腺术后吃什么最好| 色斑是什么原因引起的| 乳腺囊实性结节是什么意思| 7.6是什么日子| 老是发烧是什么原因| 维生素b族什么时候吃| 肝功十二项包括什么| 豆浆机什么牌子好| 吃什么伤口愈合的快| 什么叫窝沟封闭| 瘦的快是什么原因| 夹腿是什么意思| 洗头膏什么牌子好| 浔是什么意思| 黄芪配升麻有什么作用| 艾滋什么症状| 天厨贵人是什么意思| 女性睾酮低说明什么| 原始分是什么意思| 梦见打台球是什么意思| 靓是什么意思| 突然长胖很多是什么原因| 眼镜轴位是什么| 比宇宙还大的是什么| 肌酐低是什么原因| 眉毛痒是什么原因| 外阴皮肤痒是什么原因| 骨折后吃什么好的快| 泪沟是什么| 32岁属什么的生肖| 眼睛浮肿是什么原因引起的| 一阵一阵的胃疼是什么原因| 什么样的孕妇容易翻盘| 指甲脱层是什么原因| 世界上最难写的字是什么字| 梦到车被撞了什么预兆| 成人补锌吃什么药| pvc是什么意思| chuck是什么意思| 女子与小人难养也什么意思| 宝宝出牙晚是什么原因| 心理疾病吃什么药| 胆管结石用什么药能把它除掉| 赘肉是什么意思| 考护士证需要什么条件| 茄子有什么功效和作用| cab是什么意思| 女汉子什么意思| 玉对人身体健康有什么好处| 如常所愿是什么意思| 清江鱼又叫什么鱼| 六神无主是什么意思| 心下痞是什么意思| 幺蛾子是什么意思| 女予念什么| 吃什么补肾壮阳最快速| 扁桃体炎吃什么药最好| 什么原因导致月经量少| 幽门螺旋杆菌用什么药| 子母环是什么形状图片| 电解质水是什么| 加持什么意思| 秘密是什么意思| 外感是什么意思| 眼睛有痣代表什么| 下眼皮跳动是什么原因| 罗嘉良为什么娶苏岩| 吃什么能让子宫瘤变小| 气不够用是什么原因| 什么可以吃| 梦见自己掉头发是什么征兆| 不小心怀孕了吃什么药可以流掉| 肾素活性高是什么原因| 肌无力有什么症状| 硬度不够吃什么药调理| 出汗臭是什么原因| 牙齿遇冷热都痛是什么原因| 脑梗死吃什么药| 什么是管制| 胃动力不足吃什么药| 飞机上什么东西不能带| 孩子流鼻血是什么原因| 三文鱼长什么样| 补气血吃什么最好最快| 五更是什么生肖| 什么叫放射性疼痛| 醪糟发酸是什么原因| 手口足吃什么药| smt是什么| 什么叫靶向治疗| 打乙肝疫苗挂什么科| 什么样的人容易抑郁| 狗狗为什么会得细小| 沉香是什么| 百度Jump to content

日媒:中国打造知识产权“一带一路” 日本应取经

From Wikipedia, the free encyclopedia
百度 奚梦瑶演绎春季T恤+外套搭配Look  奚梦瑶这套装扮白T做内搭略显平凡,但是大衣的款式却不会低调,复杂和简单的结合搭配不得不服。

A binary-to-text encoding is encoding of data in plain text. More precisely, it is an encoding of binary data in a sequence of printable characters. These encodings are necessary for transmission of data when the communication channel does not allow binary data (such as email or NNTP) or is not 8-bit clean. PGP documentation (RFC 9580) uses the term "ASCII armor" for binary-to-text encoding when referring to Base64.

Overview

[edit]

The basic need for a binary-to-text encoding comes from a need to communicate arbitrary binary data over preexisting communications protocols that were designed to carry only English language human-readable text. Those communication protocols may only be 7-bit safe (and within that avoid certain ASCII control codes), and may require line breaks at certain maximum intervals, and may not maintain whitespace. Thus, only the 94 printable ASCII characters are "safe" to use to convey data.

Description

[edit]

The ASCII text-encoding standard uses 7 bits to encode characters. With this it is possible to encode 128 (i.e. 27) unique values (0–127) to represent the alphabetic, numeric, and punctuation characters commonly used in English, plus a selection of Control characters which do not represent printable characters. For example, the capital letter A is represented in 7 bits as 100 00012, 0x41 (1018) , the numeral 2 is 011 00102 0x32 (628), the character } is 111 11012 0x7D (1758), and the Control character RETURN is 000 11012 0x0D (158).

In contrast, most computers store data in memory organized in eight-bit bytes. Files that contain machine-executable code and non-textual data typically contain all 256 possible eight-bit byte values. Many computer programs came to rely on this distinction between seven-bit text and eight-bit binary data, and would not function properly if non-ASCII characters appeared in data that was expected to include only ASCII text. For example, if the value of the eighth bit is not preserved, the program might interpret a byte value above 127 as a flag telling it to perform some function.

It is often desirable, however, to be able to send non-textual data through text-based systems, such as when one might attach an image file to an e-mail message. To accomplish this, the data is encoded in some way, such that eight-bit data is encoded into seven-bit ASCII characters (generally using only alphanumeric and punctuation characters—the ASCII printable characters). Upon safe arrival at its destination, it is then decoded back to its eight-bit form. This process is referred to as binary to text encoding. Many programs perform this conversion to allow for data-transport, such as PGP and GNU Privacy Guard.

Encoding plain text

[edit]

Binary-to-text encoding methods are also used as a mechanism for encoding plain text. For example:

  • Some systems have a more limited character set they can handle; not only are they not 8-bit clean, some cannot even handle every printable ASCII character.
  • Other systems have limits on the number of characters that may appear between line breaks, such as the "1000 characters per line" limit of some Simple Mail Transfer Protocol software, as allowed by RFC 2821.
  • Still others add headers or trailers to the text.
  • A few poorly-regarded but still-used protocols use in-band signaling, causing confusion if specific patterns appear in the message. The best-known is the string "From " (including trailing space) at the beginning of a line, used to separate mail messages in the mbox file format.

By using a binary-to-text encoding on messages that are already plain text, then decoding on the other end, one can make such systems appear to be completely transparent. This is sometimes referred to as 'ASCII armoring'. For example, the ViewState component of ASP.NET uses base64 encoding to safely transmit text via HTTP POST, in order to avoid delimiter collision.

Encoding standards

[edit]

The table below compares the most used forms of binary-to-text encodings. The efficiency listed is the ratio between the number of bits in the input and the number of bits in the encoded output.

Encoding Data type Efficiency Programming language implementations Comments
Ascii85 Arbitrary 80% awk Archived 2025-08-07 at the Wayback Machine, C, C (2), C#, F#, Go, Java Perl, Python, Python (2) There exist several variants of this encoding, Base85, btoa, etc.
Base32 Arbitrary 62.5% ANSI C, Delphi, Go, Java, C# F#, Python  
Base36 Integer ~64% bash, C, C++, C#, Java, Perl, PHP, Python, Visual Basic, Swift, many others Uses the Arabic numerals 0–9 and the Latin letters A–Z (the ISO basic Latin alphabet). Commonly used by URL redirection systems like TinyURL or SnipURL/Snipr as compact alphanumeric identifiers.
Base45 Arbitrary ~67% (97%[a]) Go, Python Defined in IETF Specification RFC 9285 for including binary data compactly in a QR code.[1]
Base56 Integer PHP, Python, Go A variant of Base58 encoding which further sheds the '1' and the lowercase 'o' characters in order to minimise the risk of fraud and human-error.[2]
Base58 Integer ~73% C, C++, Python, C#, Java Similar to Base64, but modified to avoid both non-alphanumeric characters (+ and /) and letters that might look ambiguous when printed (0 – zero, I – capital i, O – capital o and l – lower-case L). Base58 is used to represent bitcoin addresses.[citation needed] Some messaging and social media systems break lines on non-alphanumeric strings. This is avoided by not using URI reserved characters such as +. For SegWit, it was replaced by Bech32, see below.
Base58 in the original bitcoin source code
Base62 Arbitrary ~74% Rust, Python Similar to Base64, but contains only alphanumeric characters.
Base64 Arbitrary 75% awk Archived 2025-08-07 at the Wayback Machine, C, C (2), Delphi, Go, Python, many others An early and still-popular encoding, first specified as part of RFC 989 in 1987
Base85 Arbitrary 80% C, Python, Python (2) Revised version of Ascii85.
Base91[3] Arbitrary 81% C# F# Constant width variant
basE91[4] Arbitrary 81% C, Java, PHP, 8086 Assembly, AWK C#, F#, Rust Variable width variant
Base94[5] Arbitrary 82% Python, C, Rust  
Base122[6] Arbitrary 87.5% JavaScript, Python, Java, Base125 Python and Javascript, Go, C  
BaseXML[7] Arbitrary 83.5% C Python JavaScript  
Bech32 Arbitrary 62.5% + at least 8 chars (label, separator, 6-char ECC) C, C++, JavaScript, Go, Python, Haskell, Ruby, Rust Specification.[8] Used in Bitcoin and the Lightning Network.[9] The data portion is encoded like Base32 with the possibility to check and correct up to 6 mistyped characters using the 6-character BCH code at the end, which also checks/corrects the Human Readable Part. The Bech32m variant has a subtle change that makes it more resilient to changes in length.[10]
BinHex Arbitrary 75% Perl, C, C (2) MacOS Classic
Decimal Integer ~42% Most languages Usually the default representation for input/output from/to humans.
Hexadecimal (Base16) Arbitrary 50% Most languages Exists in uppercase and lowercase variants
Intel HEX Arbitrary ?50% C library, C++ Typically used to program EPROM, NOR flash memory chips
MIME Arbitrary See Quoted-printable and Base64 See Quoted-printable and Base64 Encoding container for e-mail-like formatting
Percent-encoding Text (URIs), Arbitrary (RFC1738) ~40%[b] (33–70%[c]) C, Python, probably many others  
Quoted-printable Text ~33–100%[d] Probably many Preserves line breaks; cuts lines at 76 characters
S-record (Motorola hex) Arbitrary 49.6% C library, C++ Typically used to program EPROM, NOR flash memory chips. 49.6% assumes 255 binary bytes per record.
Tektronix hex Arbitrary Typically used to program EPROM, NOR flash memory chips.
TxMS Arbitrary TypeScript, CLI, Dart TxMS compresses binary data into a readable text format using Binary-to-Text encoding and allows reversible conversion back to hexadecimal.
Uuencoding Arbitrary ~60% (up to 70%) Perl, C, Delphi, Java, Python, probably many others An early encoding developed in 1980 for Unix-to-Unix Copy. Largely replaced by MIME and yEnc
Xxencoding Arbitrary ~75% (similar to Uuencoding) C, Delphi Proposed (and occasionally used) as replacement for Uuencoding to avoid character set translation problems between ASCII and the EBCDIC systems that could corrupt Uuencoded data
z85 (ZeroMQ spec:32/Z85) Binary & ASCII 80% (similar to Ascii85/Base85) C (original), C#, Dart, Erlang, Go, Lua, Ruby, Rust and others Specifies a subset of ASCII similar to Ascii85, omitting a few characters that may cause program bugs (` \ " ' _ , ;). The format conforms to ZeroMQ spec:32/Z85.
RFC 1751 (S/KEY) Arbitrary 33% C,[11] Python

"A Convention for Human-readable 128-bit Keys". A series of small English words is easier for humans to read, remember, and type in than decimal or other binary-to-text encoding systems.[12] Each 64-bit number is mapped to six short words, of one to four characters each, from a public 2048-word dictionary.[11]

The 95 isprint codes 32 to 126 are known as the ASCII printable characters.

Some older and today uncommon formats include BOO, BTOA, and USR encoding.

Most of these encodings generate text containing only a subset of all ASCII printable characters: for example, the base64 encoding generates text that only contains upper case and lower case letters, (A–Z, a–z), numerals (0–9), and the "+", "/", and "=" symbols.

Some of these encoding (quoted-printable and percent encoding) are based on a set of allowed characters and a single escape character. The allowed characters are left unchanged, while all other characters are converted into a string starting with the escape character. This kind of conversion allows the resulting text to be almost readable, in that letters and digits are part of the allowed characters, and are therefore left as they are in the encoded text. These encodings produce the shortest plain ASCII output for input that is mostly printable ASCII.

Some other encodings (base64, uuencoding) are based on mapping all possible sequences of six bits into different printable characters. Since there are more than 26 = 64 printable characters, this is possible. A given sequence of bytes is translated by viewing it as a stream of bits, breaking this stream in chunks of six bits and generating the sequence of corresponding characters. The different encodings differ in the mapping between sequences of bits and characters and in how the resulting text is formatted.

Some encodings (the original version of BinHex and the recommended encoding for CipherSaber) use four bits instead of six, mapping all possible sequences of 4 bits onto the 16 standard hexadecimal digits. Using 4 bits per encoded character leads to a 50% longer output than base64, but simplifies encoding and decoding—expanding each byte in the source independently to two encoded bytes is simpler than base64's expanding 3 source bytes to 4 encoded bytes.

Out of PETSCII's first 192 codes, 164 have visible representations when quoted: 5 (white), 17–20 and 28–31 (colors and cursor controls), 32–90 (ascii equivalent), 91–127 (graphics), 129 (orange), 133–140 (function keys), 144–159 (colors and cursor controls), and 160–192 (graphics).[13] This theoretically permits encodings, such as base128, between PETSCII-speaking machines.

See also

[edit]

Notes

[edit]
  1. ^ Encoding for QR code generation automatically selects the encoding to match the input character set, encoding 2 alphanumeric characters in 11 bits, and Base45 encodes 16 bits into 3 such characters. The efficiency is thus 32 bits of binary data encoded in 33 bits: 97%.
  2. ^ For arbitrary data; encoding all 189 non-unreserved characters with three bytes, and the remaining 66 characters with one.
  3. ^ For text; only encoding each of the 18 reserved characters.
  4. ^ One byte stored as =XX. Encoding all but the 94 characters which don't need it (incl. space and tab).

References

[edit]
  1. ^ F?ltstr?m, Patrik; Ljunggren, Freik; Gulik, Dirk-Willem van (2025-08-07). "The Base45 Data Encoding". Even in Byte mode, a typical QR code reader tries to interpret a byte sequence as text encoded in UTF-8 or ISO/IEC 8859-1. ... Such data has to be converted into an appropriate text before that text could be encoded as a QR code. ... Base45 ... offers a more compact QR code encoding.
  2. ^ Duggan, Ross (August 18, 2009). "Base-56 Integer Encoding in PHP".
  3. ^ Dake He; Yu Sun; Zhen Jia; Xiuying Yu; Wei Guo; Wei He; Chao Qi; Xianhui Lu. "A Proposal of Substitute for Base85/64 – Base91" (PDF). International Institute of Informatics and Systemics.
  4. ^ "binary to ASCII text encoding". basE91. SourceForge. Retrieved 2025-08-07.
  5. ^ "Convert binary data to a text with the lowest overhead". Vorakl's notes. April 18, 2020.
  6. ^ Albertson, Kevin (Nov 26, 2016). "Base-122 Encoding".
  7. ^ "BaseXML - for XML1.0+". GitHub. 16 March 2019.
  8. ^ "bitcoin/bips". GitHub. 8 December 2021.
  9. ^ Rusty Russell; et al. (2025-08-07). "Payment encoding in the Lightning RFC repo". GitHub.
  10. ^ "Bech32m format for v1+ witness addresses". GitHub. 5 December 2021.
  11. ^ a b RFC 1760 "The S/KEY One-Time Password System".
  12. ^ RFC 1751 "A Convention for Human-Readable 128-bit Keys"
  13. ^ "Commodore 64 PETSCII codes". sta.c64.org.
诸神黄昏什么意思 示数是什么意思 射手座和什么座最配 逍遥丸治什么病 避孕药叫什么
生姜和红糖熬水有什么作用 狗狗能看见什么颜色 总胆固醇高忌口什么 沛是什么意思 大三阳是什么病
燕麦色是什么颜色 什么是意识 十月初是什么星座 破屋是什么意思 羊肉馅饺子放什么菜
单核细胞比率偏高是什么意思 自然生化流产是什么意思 大排畸是什么检查 梦见自己头发长长了是什么意思 胆囊壁结晶是什么意思
老板娘是什么意思hcv8jop3ns8r.cn 2月9号什么星座hcv8jop4ns3r.cn 咳嗽吃什么药好hcv8jop6ns3r.cn 竹者念什么hcv9jop6ns6r.cn 什么叫青光眼hcv9jop3ns5r.cn
肝火旺是什么意思hcv8jop4ns9r.cn abby是什么意思gangsutong.com 咖啡色五行属什么hcv8jop5ns4r.cn 国际是什么意思hcv9jop7ns5r.cn 老鹰的天敌是什么hcv8jop3ns7r.cn
紫草是什么hcv7jop6ns0r.cn 血压高是什么原因引起的hcv8jop2ns0r.cn 脑梗什么原因导致的jasonfriends.com 枕大神经痛吃什么药inbungee.com 籼米是什么米hcv9jop4ns3r.cn
什么药治痒效果最好hcv8jop8ns9r.cn hpa是什么单位hcv8jop9ns6r.cn 经过的意思是什么hcv8jop8ns2r.cn 榻榻米床垫什么材质的好xinjiangjialails.com 精液是什么味道的hcv9jop2ns9r.cn
百度