This reverts commit 7b84904d15.
This commit is contained in:
parent
7b84904d15
commit
b1c276db9f
13 changed files with 234 additions and 335 deletions
|
|
@ -1,12 +1,11 @@
|
|||
import processFast from "./algorithms/fast.mjs";
|
||||
import processSlow from "./algorithms/slow.mjs";
|
||||
import processFast from "./proof-of-work.mjs";
|
||||
import processSlow from "./proof-of-work-slow.mjs";
|
||||
|
||||
const defaultDifficulty = 4;
|
||||
const algorithms = {
|
||||
fast: processFast,
|
||||
slow: processSlow,
|
||||
};
|
||||
const basePrefix = "";
|
||||
|
||||
const status = document.getElementById("status");
|
||||
const difficultyInput = document.getElementById("difficulty-input");
|
||||
|
|
@ -43,7 +42,7 @@ const benchmarkTrial = async (stats, difficulty, algorithm, signal) => {
|
|||
.join("");
|
||||
|
||||
const t0 = performance.now();
|
||||
const { hash, nonce } = await process({ basePrefix, version: "devel" }, challenge, Number(difficulty), signal);
|
||||
const { hash, nonce } = await process(challenge, Number(difficulty), signal);
|
||||
const t1 = performance.now();
|
||||
console.log({ hash, nonce });
|
||||
|
||||
|
|
@ -115,7 +114,6 @@ const benchmarkLoop = async (controller) => {
|
|||
} catch (e) {
|
||||
if (e !== false) {
|
||||
status.innerText = e;
|
||||
throw e;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue