tools-for-js 1.5.4 → 1.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/utils/string.js +4 -3
- package/package.json +1 -1
package/lib/utils/string.js
CHANGED
|
@@ -140,7 +140,7 @@ var decrypt = exports.decrypt = function decrypt(input, key) {
|
|
|
140
140
|
}
|
|
141
141
|
return output[1] || '';
|
|
142
142
|
};
|
|
143
|
-
|
|
143
|
+
|
|
144
144
|
/*******
|
|
145
145
|
* @description: 校验加密字符
|
|
146
146
|
* @author: 琴时
|
|
@@ -314,9 +314,10 @@ var fromCode = exports.fromCode = function fromCode(params) {
|
|
|
314
314
|
arr[i] = b1 * len * len + b2 * len + b3; //利用索引值,反推被加密字符的Unicode编码值
|
|
315
315
|
}
|
|
316
316
|
// 将数组转换成字符串连接起来
|
|
317
|
-
|
|
317
|
+
// let str1 = arr.join(',')
|
|
318
318
|
//用fromCharCode()算出字符串
|
|
319
|
-
result = eval('String.fromCharCode(' + str1 + ')')
|
|
319
|
+
// result = eval('String.fromCharCode(' + str1 + ')')
|
|
320
|
+
result = String.fromCharCode.apply(String, arr);
|
|
320
321
|
return result; //返回被解密的字符串
|
|
321
322
|
};
|
|
322
323
|
|