xorEncode method
string xor encryption
Implementation
String xorEncode(String content, {String? key}) {
this.key = key ?? this.key;
if (this.key != null && this.key!.isNotEmpty) {
return base64Encode(_xor(utf8.encode(content), utf8.encode(this.key!)));
} else {
return base64Encode(_encrypt(utf8.encode(content)));
}
}