NOTE
1.2 Base64
Base64 encoding, process, use cases, and comparison with URL encoding.
This is a historical learning note and may contain outdated or incomplete understanding.
1. What Is Base64
Because some systems (for example, URLs) only support ASCII characters, Base64 is a method of converting non-ASCII data into ASCII characters.
2. Base64 Process
- Divide the string to be converted into groups of 3 bytes. 1 byte = 8 bits, so each group contains exactly 24 bits.
- Divide the 24 bits above into groups of 6 bits, forming 4 groups.
- Add two 0 bits in front of each group, forming four 8-bit groups, that is, 4 bytes.
- Look up the corresponding values in the Base64 table above to form the Base64 encoding.
3. Base64 Use Cases
Transmitting binary images.
Discussion
Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub