In stringtoBase64, don't escape the input, and in base64toString don't unescape the result.