MCPcopy Index your code
hub / github.com/Effect-TS/effect / makeHashDigest

Function makeHashDigest

packages/workflow/src/internal/crypto.ts:4–15  ·  view source on GitHub ↗
(original: string)

Source from the content-addressed store, hash-verified

2
3/** @internal */
4export const makeHashDigest = (original: string) =>
5 Effect.map(
6 Effect.promise(() => crypto.subtle.digest("SHA-256", new TextEncoder().encode(original))),
7 (buffer) => {
8 const data = new Uint8Array(buffer)
9 let hexString = ""
10 for (let i = 0; i < 16; i++) {
11 hexString += data[i].toString(16).padStart(2, "0")
12 }
13 return hexString
14 }
15 )

Callers 2

Activity.tsFile · 0.85
makeExecutionIdFunction · 0.85

Calls 3

encodeMethod · 0.80
mapMethod · 0.65
toStringMethod · 0.65

Tested by

no test coverage detected