From 2074c9c732f6d279f5153688b9e33bdc8c9c7674 Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Fri, 15 Sep 2023 13:54:56 -0500 Subject: Here goes nothing! Signed-off-by: Matt Strapp --- app/src/lib/ts/crc32.worker.ts | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 app/src/lib/ts/crc32.worker.ts (limited to 'app/src/lib/ts/crc32.worker.ts') diff --git a/app/src/lib/ts/crc32.worker.ts b/app/src/lib/ts/crc32.worker.ts new file mode 100644 index 0000000..0d04c7c --- /dev/null +++ b/app/src/lib/ts/crc32.worker.ts @@ -0,0 +1,8 @@ +import crc32 from 'crc/crc32'; + +onmessage = async (message: MessageEvent) => { + const file = message.data; + const buffer = await file.arrayBuffer(); + const crc = crc32(buffer, 517762881); + postMessage(crc); +}; -- cgit v1.2.3