optimized speed
This commit is contained in:
parent
17bd03b2be
commit
c51f9484bf
3 changed files with 10 additions and 11 deletions
File diff suppressed because one or more lines are too long
|
|
@ -1409,5 +1409,5 @@ document.getElementById("save-area-read").addEventListener("click", () => {
|
||||||
|
|
||||||
export {
|
export {
|
||||||
// to use in LoadSaveFile.js for auto-analyzing file after decoding
|
// to use in LoadSaveFile.js for auto-analyzing file after decoding
|
||||||
HKReadTextArea
|
HKCheckCompletion
|
||||||
};
|
};
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
const aesjs = require("./aes-js.js");
|
const aesjs = require("./aes-js.js");
|
||||||
// For reading the text area after save decoding
|
// For reading the text area after save decoding
|
||||||
import {
|
import {
|
||||||
HKReadTextArea
|
HKCheckCompletion
|
||||||
} from "./HKCheckCompletion.js";
|
} from "./HKCheckCompletion.js";
|
||||||
|
|
||||||
const CSHARP_HEADER = [0, 1, 0, 0, 0, 255, 255, 255, 255, 1, 0, 0, 0, 0, 0, 0, 0, 6, 1, 0, 0, 0]; // 22 bytes
|
const CSHARP_HEADER = [0, 1, 0, 0, 0, 255, 255, 255, 255, 1, 0, 0, 0, 0, 0, 0, 0, 6, 1, 0, 0, 0]; // 22 bytes
|
||||||
|
|
@ -91,17 +91,16 @@ function ProcessFileObject() {
|
||||||
// Convert ArrayBuffer to string/text TextDecoder().decode(ArrayBuffer)
|
// Convert ArrayBuffer to string/text TextDecoder().decode(ArrayBuffer)
|
||||||
decodedString = new TextDecoder().decode(inputArrayBuffer);
|
decodedString = new TextDecoder().decode(inputArrayBuffer);
|
||||||
|
|
||||||
// 4. Paste decoded string file to text area
|
|
||||||
|
|
||||||
document.getElementById("save-area").value = "";
|
|
||||||
document.getElementById("save-area").value = decodedString;
|
|
||||||
|
|
||||||
// finish and show benchmark
|
// finish and show benchmark
|
||||||
benchLSFEnd = new Date();
|
benchLSFEnd = new Date();
|
||||||
console.info("LoadSaveFile() time (ms) =", benchLSFEnd - benchLSFBegin);
|
console.info("LoadSaveFile() time (ms) =", benchLSFEnd - benchLSFBegin);
|
||||||
|
|
||||||
// after pasting the decoded string, launch the main analyzing function immediately
|
// 4. Analyze the decoded string immediately
|
||||||
HKReadTextArea("save-area");
|
HKCheckCompletion(JSON.parse(decodedString));
|
||||||
|
|
||||||
|
// 5. Paste decoded string file to text area
|
||||||
|
document.getElementById("save-area").value = "";
|
||||||
|
document.getElementById("save-area").value = decodedString;
|
||||||
|
|
||||||
// finish total and show benchmark
|
// finish total and show benchmark
|
||||||
benchTotal = new Date();
|
benchTotal = new Date();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue