Load pow-sha256 polyfill to support browsers that aren't capable of

executing WASM
This commit is contained in:
realaravinth
2021-12-08 14:52:06 +05:30
parent a075607bae
commit e399f82ac4
5 changed files with 48 additions and 12 deletions

View File

@@ -19,12 +19,12 @@ import { PoWConfig, ServiceWorkerWork } from "./types";
import log from "../logger";
log.log("worker registered");
onmessage = (e) => {
onmessage = async (e) => {
console.debug("message received at worker");
const config: PoWConfig = e.data;
const t0 = performance.now();
const work = prove(config);
const work = await prove(config);
const t1 = performance.now();
const duration = t1 - t0;