Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 505 Bytes

File metadata and controls

22 lines (17 loc) · 505 Bytes

Workers

The library supports solving challenges using Web Workers.

In Node.js environments, use the web-worker package to provide compatibility with node:worker_threads.

import Worker from 'web-worker';
import { solveChallengeWorkers } from 'altcha-lib';

const workerPath = import.meta.resolve('altcha-lib/workers/pbkdf2');

const solution = await solveChallengeWorkers({
	challenge,
	concurrency: 4,
	createWorker() {
		return new Worker(workerPath, {
			type: 'module',
		});
	},
});