MCPcopy Create free account
hub / github.com/Effect-TS/effect / toHashAlgorithm

Function toHashAlgorithm

packages/platform/node-shared/src/NodeCrypto.ts:17–28  ·  view source on GitHub ↗
(algorithm: EffectCrypto.DigestAlgorithm)

Source from the content-addressed store, hash-verified

15import * as NodeCrypto from "node:crypto"
16
17const toHashAlgorithm = (algorithm: EffectCrypto.DigestAlgorithm): string => {
18 switch (algorithm) {
19 case "SHA-1":
20 return "sha1"
21 case "SHA-256":
22 return "sha256"
23 case "SHA-384":
24 return "sha384"
25 case "SHA-512":
26 return "sha512"
27 }
28}
29
30const digest: EffectCrypto.Crypto["digest"] = (algorithm, data) =>
31 Effect.try({

Callers 1

digestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected