MCPcopy Index your code
hub / github.com/simstudioai/sim / computeContentHash

Function computeContentHash

apps/sim/connectors/utils.ts:36–42  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

34 * Used by connectors for change detection during sync.
35 */
36export async function computeContentHash(content: string): Promise<string> {
37 const encoder = new TextEncoder()
38 const data = encoder.encode(content)
39 const hashBuffer = await crypto.subtle.digest('SHA-256', data)
40 const hashArray = Array.from(new Uint8Array(hashBuffer))
41 return hashArray.map((b) => b.toString(16).padStart(2, '0')).join('')
42}
43
44/**
45 * Parses a string metadata value as a Date for tag mapping.

Callers 4

discord.tsFile · 0.90
recordToDocumentFunction · 0.90
microsoft-teams.tsFile · 0.90
buildWikiContentHashFunction · 0.90

Calls 2

joinMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected