In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article is about what base64 coding refers to. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Base64 coding is one of the most common coding methods used to transmit 8Bit bytecodes on the network. Base64 is a method to represent binary data based on 64 printable characters. You can see [RFC2045~RFC2049] for detailed specifications of MIME.
Base64 coding is a process from binary to character, which can be used to transmit long identification information in HTTP environment. Base64 coding is unreadable and needs to be decoded before reading.
Base64 is widely used in various fields of computer because of the above advantages. However, because the output includes more than two "symbol class" characters (+, /, =), various "variants" of Base64 are developed in different application scenarios. In order to unify and normalize the output of Base64, Base62x is considered an improved version without symbolization.
Standard Base64 is not suitable for transmission directly in URL, because URL encoders change the "/" and "+" characters in standard Base64 into the form of "% XX", and these "%" numbers need to be converted when they are stored in the database, because the "%" sign is already used as a wildcard in ANSI SQL.
In order to solve this problem, we can use an improved Base64 coding for URL, which fills the'= 'sign at the end, and changes the "+" and "/" in the standard Base64 to "-" and "_" respectively, so as to avoid the conversion in URL encoding and decoding and database storage, avoid the increase in the length of encoded information in this process, and unify the format of object identifiers in databases, forms, and so on.
There is also an improved Base64 variant for regular expressions that changes "+" and "/" to "!" And "-", because "+", "*" and "[" and "]" previously used in IRCu may have special meanings in regular expressions.
There are also variants that change "+ /" to "_ -" or ". _" (used as an identifier name in the programming language) or ". -" (for Nmtoken in XML) or even "_:" (for Name in XML).
Base64 requires that every three bytes of 8Bit be converted into four bytes of 6Bit (3x8 = 4x6 = 24), and then add two more high-order zeros to the 6Bit to form four 8Bit bytes, that is, the converted string will theoretically be 1max / 3 longer than the original.
Rules
The rules about this code:
1. Change 3 bytes into 4 bytes.
② adds a newline character for every 76 characters.
3. The final Terminator should also be dealt with.
Examples
11111111, 11111111, 11111111 (binary) before conversion
00111111, 00111111, 00111111, 00111111 (binary) after conversion
The top three bytes are the original text, and the next four bytes are converted Base64 encodings, with the first two bits 0.
After the conversion, we use a code table to get the string we want (that is, the final Base64 encoding).
Thank you for reading! This is the end of the article on "what does base64 coding mean?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
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.