aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/lib/ts
diff options
context:
space:
mode:
authorMatt Strapp <matt@mattstrapp.net>2023-09-15 13:54:56 -0500
committerMatt Strapp <matt@mattstrapp.net>2023-09-15 13:56:50 -0500
commit2074c9c732f6d279f5153688b9e33bdc8c9c7674 (patch)
tree0ae640f9966cc8ae74abe28a1520b23ac610c604 /app/src/lib/ts
parentCreate dependabot.yml (diff)
downloadtrinkets-2074c9c732f6d279f5153688b9e33bdc8c9c7674.tar
trinkets-2074c9c732f6d279f5153688b9e33bdc8c9c7674.tar.gz
trinkets-2074c9c732f6d279f5153688b9e33bdc8c9c7674.tar.bz2
trinkets-2074c9c732f6d279f5153688b9e33bdc8c9c7674.tar.lz
trinkets-2074c9c732f6d279f5153688b9e33bdc8c9c7674.tar.xz
trinkets-2074c9c732f6d279f5153688b9e33bdc8c9c7674.tar.zst
trinkets-2074c9c732f6d279f5153688b9e33bdc8c9c7674.zip
Here goes nothing!
Signed-off-by: Matt Strapp <matt@mattstrapp.net>
Diffstat (limited to '')
-rw-r--r--app/src/lib/ts/crc32.worker.ts8
1 files changed, 8 insertions, 0 deletions
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<File>) => {
+ const file = message.data;
+ const buffer = await file.arrayBuffer();
+ const crc = crc32(buffer, 517762881);
+ postMessage(crc);
+};