MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / verifyArchive

Function verifyArchive

apps/kimi-code/src/utils/process/fd-detect.ts:141–146  ·  view source on GitHub ↗
(path: string, expectedSha256: string)

Source from the content-addressed store, hash-verified

139}
140
141function verifyArchive(path: string, expectedSha256: string): void {
142 const actualSha256 = createHash('sha256').update(readFileSync(path)).digest('hex');
143 if (actualSha256 !== expectedSha256) {
144 throw new Error(`fd archive checksum mismatch: ${actualSha256} !== ${expectedSha256}`);
145 }
146}
147
148async function downloadFile(url: string, dest: string): Promise<void> {
149 const response = await fetch(url, { signal: AbortSignal.timeout(DOWNLOAD_TIMEOUT_MS) });

Callers 1

downloadFdFunction · 0.85

Calls 1

updateMethod · 0.65

Tested by

no test coverage detected