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