newline base64Encode bug when using very long strings

newline base64Encode bug when using very long strings

Hello, 

I have a bizarre bug to report using the base64Encode function. When trying to encode a very long string like this:

  1. tokenStr = "averyveryveryveryveryveryveryveryveryveryveryveryverylongusername:anotherveryveryveryverylongtokentypeofpassword";
  2. auth = zoho.encryption.base64Encode(tokenStr);
As you can see below, the result of the encoding includes a newline (which is invalid):

  1. YXZlcnl2ZXJ5dmVyeXZlcnl2ZXJ5dmVyeXZlcnl2ZXJ5dmVyeXZlcnl2ZXJ5dmVyeXZlcnlsb25n
    dXNlcm5hbWU6YW5vdGhlcnZlcnl2ZXJ5dmVyeXZlcnlsb25ndG9rZW50eXBlb2ZwYXNzd29yZA==

As a hackish work around I had to remove any newlines from the resulting encoded string:

  1. auth = zoho.encryption.base64Encode(tokenStr).remove("\n");