encodeString method

String encodeString(
  1. String message, [
  2. bool encodeBase64 = true
])

Encodes a string into another string via RC4 encryption.

Please note that the method uses UTF-8 text encoding when converting strings to binary data. If you want to use another string encoding, please convert your string into bytes using your own encoding and pass your data to RC4.encodeBytes.

encodeBase64 represents if the result should be base64 encoded.

Implementation

String encodeString(String message, [bool encodeBase64 = true]) {
  var crypted = _crypt(utf8.encode(message));
  return encodeBase64 ? base64.encode(crypted) : utf8.decode(crypted);
}