xorDecodeBytesToString method

String xorDecodeBytesToString(
  1. List<int> bytes, {
  2. String? key,
})

string to bytes xor decryption

Implementation

String xorDecodeBytesToString(List<int> bytes, {String? key}) {
  this.key = key ?? this.key;
  if (this.key != null && this.key!.isNotEmpty) {
    return utf8.decode(_xor(bytes, utf8.encode(this.key!)));
  } else {
    return utf8.decode(_decrypt(bytes));
  }
}