Partition Data: Divide the binary data to be encoded into blocks of 6 bits each.
Convert to Integers: Convert each 6-bit block into an integer value ranging from 0 to 63.
Map to Character Set: Use a character set with 64 characters, mapping each integer value to the corresponding character.
Padding: If the original data's length is not a multiple of 3, add 1 to 2 additional bytes at the end and use one or two equal signs ('=')
in the Base64 encoding to ensure a length that is a multiple of 4.
Base64 Decoding Principles
Character to Integer: Map Base64 encoded characters back to integer values.
Integer to Binary Blocks: Convert integer values back to 6-bit binary blocks.
Combine Blocks: Assemble all binary blocks to form the original binary data.