base64 encode string values, and save type