How Base64 Works: The Algorithm Behind Encoding