In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the relevant knowledge of "how base64 coding is". In the operation of actual cases, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Base64 coding requires the conversion of three 8-bit bytes (3-bit 8-bit 24) into four 6-bit bytes (4-bit 6-bit 24), followed by two zeros in front of 6 bits to form 8-bit one-byte form. If the remaining characters are less than 3 bytes, they are filled with 0, and the output characters are filled with'=', so 1 or 2'= 'may appear at the end of the output text after encoding.
The Origin of Base64 coding
A long time ago, e-mail was just published, when messages were all delivered in English. Later, after the opening of the Internet in China, the use of e-mail also increased greatly, at this time there was a demand for e-mail in Chinese. But Chinese can not be effectively processed during transmission, then Base comes out. Base64 encodes these Chinese characters and converts them into data that can be recognized by the server and gateway. At this point, you can use e-mail to transmit effectively.
The above example does not mean that Base64 was created specifically for e-mail. It has been widely used in various fields since its birth. For example, if we send pictures on the network, we can Base64 to process the pictures first, and then we can transmit them effectively.
OK, we have a general idea of its use, and then we will take a good look at its principle and exactly how to encode the data.
In order to ensure that the output code bits are readable characters, Base64 has developed a coding table for unified conversion. The size of the coding table is 2 ^ 6 = 64, which is the origin of the Base64 name.
Base64 coding table
Code value character
0 A 8 I 16 Q 24 Y 32 g 40 o 48 w 56 4
1 B 9 J 17 R 25 Z 33 h 41 p 49 x 57 5
2 C 10 K 18 S 26 a 34 i 42 q 50 y 58 6
3 D 11 L 19 T 27 b 35 j 43 r 51 z 59 7
4 E 12 M 20 U 28 c 36 k 44 s 52 0 60 8
5 F 13 N 21 V 29 d 37 l 45 t 53 1 61 9
6 G 14 O 22 W 30 e 38 m 46 U 54 2 62 +
7 H 15 P 23 X 31 f 39 n 47 v 55 3 63 /
This is the end of the content of "how base64 coding is". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.