加入了pako和axios的测试。
This commit is contained in:
22
code/ts/pako/src/index.js
Normal file
22
code/ts/pako/src/index.js
Normal file
File diff suppressed because one or more lines are too long
37
code/ts/pako/src/utils/StringConverter.js
Normal file
37
code/ts/pako/src/utils/StringConverter.js
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2023-02-13 14:54:46
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-13 14:55:19
|
||||
* @FilePath: /pako/src/utils/StringConverter.js
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
|
||||
function Uint8ArrayToString(fileData)
|
||||
{
|
||||
var dataString = "";
|
||||
for (var i = 0; i < fileData.length; i++)
|
||||
{
|
||||
dataString += String.fromCharCode(fileData[i]);
|
||||
}
|
||||
|
||||
return dataString;
|
||||
}
|
||||
|
||||
function stringToUint8Array(str)
|
||||
{
|
||||
var arr = [];
|
||||
|
||||
for (var i = 0, j = str.length; i < j; ++i)
|
||||
{
|
||||
arr.push(str.charCodeAt(i));
|
||||
}
|
||||
|
||||
var tmpUint8Array = new Uint8Array(arr);
|
||||
|
||||
return tmpUint8Array;
|
||||
}
|
||||
|
||||
export { Uint8ArrayToString, stringToUint8Array };
|
Reference in New Issue
Block a user