MCPcopy Create free account
hub / github.com/apache/tvm / extractHashFromPointer

Method extractHashFromPointer

web/src/artifact_cache.ts:304–316  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

302 }
303
304 private async extractHashFromPointer(url: string): Promise<string | null> {
305 const rawUrl = url.replace(/\/resolve\//, "/raw/");
306 try {
307 const text = await fetch(rawUrl).then((res) => res.text());
308 if (!text.includes("oid sha256:")) {
309 return null;
310 }
311 const match = text.match(/oid sha256:([A-Fa-f0-9]+)/);
312 return match ? match[1] : null;
313 } catch {
314 return null;
315 }
316 }
317
318 private async getBlobHash(blob: Blob): Promise<CrossOriginHashDescriptor> {
319 const arrayBuffer = await blob.arrayBuffer();

Callers 1

getFileHashMethod · 0.95

Calls 2

replaceMethod · 0.45
matchMethod · 0.45

Tested by

no test coverage detected