| 1 | /** |
| 2 | * The `NodeCrypto` module provides the Node.js `Crypto` service layer for |
| 3 | * Effect programs. Provide {@link layer} at the edge of a Node application, |
| 4 | * CLI, script, or test to satisfy `effect/Crypto` with Node's `node:crypto` |
| 5 | * implementation for secure random bytes, UUID generation, random values, and |
| 6 | * SHA digest operations. |
| 7 | * |
| 8 | * This module is the public Node adapter around the shared Node-compatible |
| 9 | * implementation. Digest failures are reported as platform errors, and SHA-1 |
| 10 | * remains available only for interoperability with existing protocols. |
| 11 | * |
| 12 | * @since 1.0.0 |
| 13 | */ |
| 14 | import * as NodeCrypto from "@effect/platform-node-shared/NodeCrypto" |
| 15 | import type * as Crypto from "effect/Crypto" |
| 16 | import type * as Layer from "effect/Layer" |
| 17 | |
| 18 | /** |
| 19 | * Layer that provides the Node.js Crypto service implementation. |
| 20 | * |
| 21 | * @category layers |
| 22 | * @since 1.0.0 |
| 23 | */ |
| 24 | export const layer: Layer.Layer<Crypto.Crypto> = NodeCrypto.layer |