MCPcopy
hub / github.com/serverless/serverless / hashFile

Function hashFile

packages/serverless/lib/plugins/aws/lib/hash-file.js:23–26  ·  view source on GitHub ↗
(filePath)

Source from the content-addressed store, hash-verified

21 * @returns {Promise<string>} base64-encoded SHA-256
22 */
23export async function hashFile(filePath) {
24 const buf = await readFile(filePath)
25 return crypto.createHash('sha256').update(buf).digest('base64')
26}
27
28/**
29 * Compute the SHA-256 hash of an in-memory string or Buffer.

Callers 2

_detectCodeChangesFunction · 0.90
hash-file.test.jsFile · 0.90

Calls 2

readFileFunction · 0.50
updateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…