加入了pako和axios的测试。

This commit is contained in:
2023-02-13 16:52:44 +08:00
parent 946cf852d2
commit db0ac8c960
28 changed files with 2048 additions and 1587 deletions

View File

@@ -0,0 +1,38 @@
/*
* @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: Uint8Array): string
{
let dataString: string = "";
for (let i = 0; i < fileData.length; i++)
{
dataString += String.fromCharCode(fileData[i]);
}
return dataString;
}
function stringToUint8Array(str: string): Uint8Array
{
const arr: number[] = [];
for (let i = 0, j = str.length; i < j; ++i)
{
arr.push(str.charCodeAt(i));
}
const tmpUint8Array: Uint8Array = new Uint8Array(arr);
return tmpUint8Array;
}
export { Uint8ArrayToString, stringToUint8Array };