xorEncodeBytes method

List<int> xorEncodeBytes(
  1. List<int> bytes, {
  2. String? secretKey,
})

bytes xor encryption

Implementation

List<int> xorEncodeBytes(List<int> bytes, {String? secretKey}) {
  this.secretKey = secretKey ?? this.secretKey;
  if (this.secretKey != null && this.secretKey!.isNotEmpty) {
    return _xor(bytes, utf8.encode(this.secretKey!));
  } else {
    return _encrypt(bytes);
  }
}