In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Today, I will talk to you about what the role of base64 coding is, many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.
The use of base64 coding: 1, the data of non-ASCII characters into ASCII characters; 2, it is especially suitable for fast data transmission under http and mime protocols; 3, the data content is encoded for transmission, which is safe and simple.
The use of base64 coding:
1. Base64 action
Because only ASCII characters can be used in some systems. Base64 is a method used to convert data from non-ASCII characters to ASCII characters.
Base64 is particularly suitable for fast data transfer under the http,mime protocol.
Base64 is not an encryption and decryption algorithm in the security field. Although sometimes we often see the so-called base64 encryption and decryption. In fact, base64 can only be regarded as a coding algorithm, which encodes the data content to fit for transmission. Although the original text is transformed into an invisible character format after base64 coding, this approach is very rudimentary and simple.
2. Application of Base64 coding
Base64 coding can be used to transmit long identification information in a HTTP environment. For example, in the Java Persistence system Hibernate, Base64 is used to encode a long unique identifier (typically the UUID of 128-bit) into a string to be used as a parameter in HTTP forms and HTTP GET URL. In other applications, it is also often necessary to encode binary data in a form suitable for placement in URL (including hidden form fields). At this time, Base64 coding is not only short, but also unreadable, that is, the encoded data will not be directly seen by the naked eye.
However, 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 not only removes the filled'= 'sign at the end, but also 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) and even "_:" (for Name in XML).
3. Other applications
1) Mozilla Thunderbird and Evolution use Base64 to keep email passwords secret
2) Base64 is also often used as a simple "encryption" to protect some data, while real encryption is usually cumbersome.
3) spammers use Base64 to avoid anti-spam tools, which usually do not translate Base64 messages.
4) in LDIF files, Base64 is used as an encoding string.
After reading the above, do you have any further understanding of the function of base64 coding? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
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.