feat: move calculation intensive part into a web worker

This commit is contained in:
2026-09-13 21:51:13 +02:00
parent a57ead61b9
commit b58bf8af6d
6 changed files with 182 additions and 149 deletions
+14
View File
@@ -0,0 +1,14 @@
import { wrap } from 'comlink'
import CryptWorker from './worker?worker'
import type { packContent, unpackContent } from '@cryptgeon/shared'
export function createWorker() {
const worker = new CryptWorker()
return wrap<WorkerConract>(worker)
}
export type WorkerConract = {
pack: typeof packContent
unpack: typeof unpackContent
}