Function
toHashAlgorithm
(algorithm: EffectCrypto.DigestAlgorithm)
Source from the content-addressed store, hash-verified
| 15 | import * as NodeCrypto from "node:crypto" |
| 16 | |
| 17 | const 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 | |
| 30 | const digest: EffectCrypto.Crypto["digest"] = (algorithm, data) => |
| 31 | Effect.try({ |
Tested by
no test coverage detected