xorCode static method
异或对称加密
Implementation
static String xorCode(String res, String key) {
List<String> keyList = key.split(',');
List<int> codeUnits = res.codeUnits;
List<int> codes = [];
for (int i = 0, length = codeUnits.length; i < length; i++) {
int code = codeUnits[i] ^ int.parse(keyList[i % keyList.length]);
codes.add(code);
}
return String.fromCharCodes(codes);
}