增加 CRC Hex 输入并修复依赖漏洞
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { calculateCrcReport, type CrcWorkerRequest, type CrcWorkerResponse } from '@/lib/crcWorker'
|
||||
import { calculateCrcHexInput, calculateCrcReport, type CrcWorkerRequest, type CrcWorkerResponse } from '@/lib/crcWorker'
|
||||
import { getFirmwareFormat, MAX_FIRMWARE_FILE_SIZE, parseFirmwareContent } from '@/lib/firmware'
|
||||
import type { DataBlock } from '@/lib/intelHex'
|
||||
|
||||
@@ -31,6 +31,14 @@ workerScope.onmessage = async (event) => {
|
||||
})
|
||||
return
|
||||
}
|
||||
if (request.type === 'calculate-hex') {
|
||||
workerScope.postMessage({
|
||||
type: 'calculated-hex',
|
||||
id: request.id,
|
||||
...calculateCrcHexInput(request.input, request.parameters),
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!firmwareBlocks) throw new Error('请先选择 BIN 或 Intel HEX 文件')
|
||||
workerScope.postMessage({ type: 'calculated', id: request.id, ...calculateCrcReport(firmwareBlocks, request.parameters) })
|
||||
} catch (reason) {
|
||||
|
||||
Reference in New Issue
Block a user