The array of bytes from the previous step is converted into alphanumeric text. Bytes are divided into 8 bytes long pieces from its beginning. Because the total number of bytes is not always divisible of 8, the last piece length can be from 1 to 8 bytes. Every piece as 8 bytes long big-endian unsigned integer value is then converted into base 57 number where every 57 base digit corresponds to the character index at the base57 alphabet shown below. In this case least significant base 57 characters are added to the text first. base57 alphabet contains digits and uppercase & lowercase letters except for these 5 ambiguous characters: 0 I O l u:
123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstvwxyz
The following table shows the number of base 57 characters needed to store a certain number of bytes:
number of base57 characters |
number of bits |
number of bits rounded |
number of bytes |
2 |
11.67 |
8 |
1 |
3 |
17.50 |
16 |
2 |
5 |
29.16 |
24 |
3 |
6 |
35.00 |
32 |
4 |
7 |
40.83 |
40 |
5 |
9 |
52.50 |
48 |
6 |
10 |
58.33 |
56 |
7 |
11 |
64.16 |
64 |
8 |
Example: B3 DA 0C
Piece = 0xB3DA0C
step |
piece |
mod 57 = base57 character value |
base57 character |
1 |
0xB3DA0C |
19 |
L |
2 |
0x0327C1 |
46 |
o |
3 |
0x000E2B |
36 |
d |
4 |
0x00003F |
6 |
7 |
5 |
0x000001 |
1 |
2 |
Result = Lod72