This article is a mirror article of machine translation, please click here to jump to the original article.

View: 2804|Reply: 2

Base64 encoded string composition (what characters are in Base64)

[Copy link]
Posted on 7/18/2023 6:39:51 PM | | |
What is Base64?

Base64 is an encoding method that converts binary data into displayable characters in the ASCII character set for transmission and storage without compromising data integrity. Base64 encoding is reversible, meaning that the encoded data can be restored to the original binary data.

Base64 encoding table

Base64 encoding64 characters were used, including 26 uppercase letters, 26 lowercase letters, 10 numbers, and two special characters "+" and "/". Here's the full Base64 encoding table:

  • Uppercase and lowercase letters (52 in total): A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u、v、w、x、y、z。
  • Numbers (10 in total): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.
  • Symbols (2 in total): +, /.


Base64 special characters

Base64 encoding contains twoSpecial characters "+" and "/", which have ASCII codes of 43 and 47 in the character set, respectively. These two characters are where Base64 encoding tends to cause problems, as some software systems do not recognize them. In practice, it is sometimes necessary to replace these two special characters with other characters, such as when using Base64 encoding in a URL, you need to replace "+" with "-" and "/" with "_".

How Base64 is encoded

Base64 encoding groups binary data into groups of every 6 bits, and the values of each group are used as indexes to find the corresponding characters in the Base64 encoding table, so that the encoded string is obtained. If the grouped data is less than 6 bits, add "0" at the end to make up 6 bits, inThe result is indicated by "="

Base64 applications

Base64 is widely used. In network transmission, data needs to be Base64 encoded to address these issues due to certain protocols or software imposing restrictions on the transmitted data format. For example, in email, Base64 encoding is required because the mail transfer protocol only supports text format and binaries must be encoded as ASCII characters to be transferred. In addition, Base64 encoding is often used when transferring parameters in URLs to avoid character set incompatibilities.





Previous:.NET/C# NamedPipe-based NamedPipe Cross-Process Communication [with Source Code]
Next:.NET/C# lightweight Mapster object mapping framework
 Landlord| Posted on 5/17/2024 1:18:47 PM |
Failed to execute 'atob' on 'Window': The string to be decoded is not...
https://www.itsvse.com/thread-10770-1-1.html
 Landlord| Posted on 10/17/2025 9:02:43 AM |
Detailed explanation of blockchain Base58, Base58Check, Bech32, and Bech32m coding
https://www.itsvse.com/thread-11095-1-1.html
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com