aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/lib/ts/crc32.worker.ts
blob: 0d04c7c6e295fdff54aacb9138f0e553a918a3f1 (plain) (blame)
1
2
3
4
5
6
7
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);
};