Files
masyunis/web/js/algorithms/fast.ts
T
sol_bot Bot e07de898cd Import Anubis v1.28.2
Replace the tree with upstream TecharoHQ/anubis v1.28.2 (a1384fbf42e3).
Masyunis customizations are re-applied in the following commits.
2026-11-28 14:52:26 +03:00

27 lines
643 B
TypeScript

import {
ProgressCallback,
ProcessOptions,
ProcessResult,
defaultThreads,
runWorkers,
} from "@lib/worker";
export default async function process(
options: ProcessOptions,
data: string,
difficulty: number = 5,
signal: AbortSignal | null = null,
progressCallback?: ProgressCallback,
threads: number = defaultThreads(),
): Promise<ProcessResult> {
console.debug("fast algo");
return runWorkers({
webWorkerURL: `${options.basePrefix}/.within.website/x/cmd/anubis/static/js/worker/sha256.mjs?cacheBuster=${options.version}`,
message: { data, difficulty },
threads,
signal,
progressCallback,
});
}