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

Method getBlobHash

web/src/artifact_cache.ts:318–329  ·  view source on GitHub ↗
(blob: Blob)

Source from the content-addressed store, hash-verified

316 }
317
318 private async getBlobHash(blob: Blob): Promise<CrossOriginHashDescriptor> {
319 const arrayBuffer = await blob.arrayBuffer();
320 const hashBuffer = await crypto.subtle.digest(HASH_ALGORITHM, arrayBuffer);
321 const hashArray = Array.from(new Uint8Array(hashBuffer));
322 const hashHex = hashArray
323 .map((byte) => byte.toString(16).padStart(2, "0"))
324 .join("");
325 return {
326 algorithm: HASH_ALGORITHM,
327 value: hashHex,
328 };
329 }
330}
331
332

Callers 1

putMethod · 0.95

Calls 2

joinMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected