LoadSaveFile benchmark
This commit is contained in:
parent
3f6efd3514
commit
15dcbcaab7
1 changed files with 9 additions and 0 deletions
|
|
@ -6,6 +6,8 @@ const BASE64_DECODE_TABLE = new Map(BASE64_ARRAY.map((ord, i) => [ord, i]));
|
||||||
const AES_KEY = new TextEncoder().encode('UKu52ePUBwetZ9wNX88o54dnfKRu0T1l'); // encodes to Uint8Array
|
const AES_KEY = new TextEncoder().encode('UKu52ePUBwetZ9wNX88o54dnfKRu0T1l'); // encodes to Uint8Array
|
||||||
const ECB_STREAM_CIPHER = new aesjs.ModeOfOperation.ecb(AES_KEY); // create a new AES stream cipher object
|
const ECB_STREAM_CIPHER = new aesjs.ModeOfOperation.ecb(AES_KEY); // create a new AES stream cipher object
|
||||||
|
|
||||||
|
let bench = { begin: 0, end: 0 };
|
||||||
|
|
||||||
// console.log(`AES_KEY: ${AES_KEY}`);
|
// console.log(`AES_KEY: ${AES_KEY}`);
|
||||||
// console.log(`ECB_STREAM_CIPHER: ${ECB_STREAM_CIPHER}`);
|
// console.log(`ECB_STREAM_CIPHER: ${ECB_STREAM_CIPHER}`);
|
||||||
|
|
||||||
|
|
@ -18,6 +20,9 @@ function ShowFile(input) {
|
||||||
|
|
||||||
// main input tag file function
|
// main input tag file function
|
||||||
function LoadSaveFile(input) {
|
function LoadSaveFile(input) {
|
||||||
|
// start benchmark
|
||||||
|
bench.begin = new Date();
|
||||||
|
|
||||||
// Prepares a File object from the first file of the input files for reading as an Array Buffer
|
// Prepares a File object from the first file of the input files for reading as an Array Buffer
|
||||||
let inputFileObject = input.files[0];
|
let inputFileObject = input.files[0];
|
||||||
|
|
||||||
|
|
@ -65,6 +70,10 @@ function ProcessFileObject() {
|
||||||
document.getElementById("save-area").value = "";
|
document.getElementById("save-area").value = "";
|
||||||
document.getElementById("save-area").value = decodedString;
|
document.getElementById("save-area").value = decodedString;
|
||||||
|
|
||||||
|
// finish and show benchmark
|
||||||
|
bench.end = new Date();
|
||||||
|
console.info("LoadSaveFile() time (ms) =", bench.end - bench.begin);
|
||||||
|
|
||||||
// after pasting the decoded string, launch the main analyzing function immediately
|
// after pasting the decoded string, launch the main analyzing function immediately
|
||||||
HKReadTextArea();
|
HKReadTextArea();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue