update base64 encoding implementation