}
String _stepThree(String str) {
return str;
}String _inverse(String tag) {
String res = ‘’;
List searchKeywords =
List.generate(tag.length, (index) => tag[index]);
Iterable array = searchKeywords.reversed;
for (var e in array) {res = ‘ r e s res rese’;
}
return res;
}String _ivStepOne() {
String res = ‘’;
String map = _generateMd5(chatSign) + _generateMd5(nickName);
int index = _gameIdSort[_gameIdSort.length - 2];
while (res.length < 50) {res += map[index];
index++;
}
index = 0;
return res;
}String _ivStepTwo() {
String res = ‘’;
String map = _generateMd5(_inverse(chatSign)) + _generateMd5(chatSign);
int index = _gameIdSort[_gameIdSort.length - 1];
while (res.length < 50) {res += map[index];
index++;
}
index = 0;
return _inverse(res);
}/// 字符串转 十六进制
String _strToHex(String str) {List charCodes = str.runes.toList();
return charCodes.map((code) => code.toRadixString(16)).join(‘’);
}/// 字符串转 base64
String _encodeBase64(String data) {return base64Encode(utf8.encode(data));
}/// base64转 普通字符
String _decodeBase64(String data) {return String.fromCharCodes(base64Decode(data));
}String _generateMd5(String str) {
return md5.convert(utf8.encode(str)).toString();
}int _magic(int num) {
if (num < 3) {
return 1;
} else {return _magic(num - 1) + _magic(num - 2);
}
}
}
调用的地方:
MatchRequestData data = MatchRequestData (
gameId: userArray[i][‘gameID’],
chatSign: userArray[i][‘chatSign’],
nickName: userArray[i][‘nickName’],
);//需要传递给
版权归原作者 2401_84166236 所有, 如有侵权,请联系我们删除。