mirror of
https://github.com/keven1024/015.git
synced 2026-05-26 15:13:30 +00:00
9 lines
243 B
TypeScript
9 lines
243 B
TypeScript
import calcFileHash from './calcFileHash'
|
|
|
|
// 监听主线程消息
|
|
self.onmessage = async (e: MessageEvent<{ file: File }>) => {
|
|
const { file } = e.data || {}
|
|
const hash = await calcFileHash({ file })
|
|
self.postMessage({ hash })
|
|
}
|