MCPcopy Create free account
hub / github.com/effect-app/libs / digest

Function digest

repos/effect/packages/platform-node-shared/src/NodeCrypto.ts:30–41  ·  view source on GitHub ↗
(algorithm, data)

Source from the content-addressed store, hash-verified

28}
29
30const digest: EffectCrypto.Crypto["digest"] = (algorithm, data) =>
31 Effect.try({
32 try: () => Uint8Array.from(NodeCrypto.createHash(toHashAlgorithm(algorithm)).update(data).digest()),
33 catch: (cause) =>
34 PlatformError.systemError({
35 module: "Crypto",
36 method: "digest",
37 _tag: "Unknown",
38 description: "Could not compute digest",
39 cause
40 })
41 })
42
43/**
44 * The default Node.js Crypto service implementation.

Callers

nothing calls this directly

Calls 3

toHashAlgorithmFunction · 0.85
digestMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…