|
49
|
|
|
x
|
|
|
16
|
|
|
Q
|
|
|
33
|
|
|
h
|
|
|
50
|
|
|
y
|
|
|
The example below, from :rfc:`4648`, illustrates the `Base64` encoding.
|
|
|
Input data
|
|
|
`0x14fb9c03d97e`
|
|
|
8-bit
|
|
|
00010100 11111011 10011100 00000011 11011001 01111110
|
|
|
6-bit
|
|
|
000101 001111 101110 011100 000000 111101 100101 111110
|
|
|
Decimal
|
|
|
5 15 46 28 0 61 37 62
|
|
|
F P u c A 9 l \+
|
|
|
The last point to be discussed about `base64` is what happens when the length of the sequence of bytes to be encoded is not a multiple of three. In this case, the last group of bytes may contain one or two bytes instead of three. `Base64` reserves the `=` character as a padding character. This character is used once when the last group contains two bytes and twice when it contains one byte as illustrated by the two examples below.
|
|
|
0x14
|
|