import { PowHelper } from "@iota/iota.js" ; import { parentPort , workerData } from "worker_threads" ; param powDigest param targetZeros param startIndex returns export function doPow ( powDigest , targetZeros , startIndex ) { return PowHelper . performPow ( powDigest , targetZeros , startIndex ) ; } if ( workerData && parentPort ) { const nonce = doPow ( workerData . powDigest as Uint8Array , workerData . targetZeros as number , workerData . startIndex as string ) ; parentPort . postMessage ( nonce ) ; }