MCPcopy Create free account
hub / github.com/fontsource/fontsource / getHash

Function getHash

packages/publish/src/hash.ts:25–34  ·  view source on GitHub ↗
(dir: string)

Source from the content-addressed store, hash-verified

23};
24
25const getHash = async (dir: string): Promise<string> => {
26 const files = await getAllFiles(dir);
27 const hasher = await createXXHash64();
28 hasher.init();
29 for (const file of files) {
30 const contents = await fs.readFile(file);
31 hasher.update(contents);
32 }
33 return hasher.digest();
34};
35
36export { getAllFiles, getHash };

Callers 2

handleHashFunction · 0.90
hash.test.tsFile · 0.90

Calls 1

getAllFilesFunction · 0.85

Tested by

no test coverage detected