MCPcopy Create free account
hub / github.com/EmNudge/watlings / getSha1Hash

Function getSha1Hash

scripts/utils/compileFiles.mjs:12–20  ·  view source on GitHub ↗
(buffer)

Source from the content-addressed store, hash-verified

10 * @returns {Promise<string>}
11 */
12const getSha1Hash = async (buffer) => {
13 const byteHash = await webcrypto.subtle.digest("SHA-1", buffer);
14
15 const hash = Array.from(new Uint8Array(byteHash))
16 .map((b) => b.toString(16).padStart(2, "0"))
17 .join("");
18
19 return hash;
20};
21
22/**
23 * Get list of files that have since been updated since last run

Callers 2

getChangedFilesFunction · 0.85
compileFilesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected