Convert hex string to base64 string