NOTE

1.2 Base64

Base64 encoding, process, use cases, and comparison with URL encoding.

SecurityCreated Updated 1 min readhistorical

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

  1. Divide the string to be converted into groups of 3 bytes. 1 byte = 8 bits, so each group contains exactly 24 bits.
  2. Divide the 24 bits above into groups of 6 bits, forming 4 groups.
  3. Add two 0 bits in front of each group, forming four 8-bit groups, that is, 4 bytes.
  4. Look up the corresponding values in the Base64 table above to form the Base64 encoding.

3. Base64 Use Cases

Transmitting binary images.

4. Base64 vs URL Encoding

URL encoding

5. References

Discussion

Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub