mirror of
https://github.com/keven1024/015.git
synced 2026-06-03 10:59:35 +00:00
feat(front): enhance file hash calculation by introducing engine selection for large files using native or wasm methods
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import calcFileHash from './calcFileHash'
|
||||
|
||||
// 监听主线程消息
|
||||
self.onmessage = async (e: MessageEvent<{ file: File }>) => {
|
||||
const { file } = e.data || {}
|
||||
const hash = await calcFileHash({ file })
|
||||
self.onmessage = async (e: MessageEvent<{ file: File; engine?: 'native' | 'wasm' }>) => {
|
||||
const { file, engine } = e.data || {}
|
||||
const hash = await calcFileHash({ file, engine })
|
||||
self.postMessage({ hash })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user