# Engine

Node.js implementations of Ox's supported cryptographic primitives, backed
by `node:crypto`.

Import this entrypoint only in Node.js. Its static `node:crypto` dependency
is intentionally kept outside Ox's runtime-neutral entrypoint.

## Examples

```ts twoslash
// @noErrors
import { Engine, Hash } from 'ox/node'

await Engine.install()

Hash.sha256('0xdeadbeef')
```

## Functions

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`Engine.engine`](/node/crypto/Engine/engine) | Creates every Node.js implementation this entrypoint provides, without installing it. |
| [`Engine.get`](/node/crypto/Engine/get) | Returns the installed engine. |
| [`Engine.install`](/node/crypto/Engine/install) | Installs every Node.js implementation this entrypoint provides. |
| [`Engine.reset`](/node/crypto/Engine/reset) | Restores ox's default implementations. |
| [`Engine.set`](/node/crypto/Engine/set) | Installs crypto implementations, replacing the `@noble/*` implementations ox uses by default. |
| [`Engine.with`](/node/crypto/Engine/with) | Runs a function with an engine installed, then restores the previous engine. |

## Errors

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`Engine.AsyncScopeError`](/node/crypto/Engine/errors#engineasyncscopeerror) | Thrown when [`Engine.with`](/node/crypto/Engine/with) is given an asynchronous function. |
| [`Engine.InvalidSlotValueError`](/node/crypto/Engine/errors#engineinvalidslotvalueerror) | Thrown when an engine slot is not an object or `undefined`. |
| [`Engine.UnknownPrimitiveError`](/node/crypto/Engine/errors#engineunknownprimitiveerror) | Thrown when a slot is given an unrecognized primitive name. |
| [`Engine.UnknownSlotError`](/node/crypto/Engine/errors#engineunknownsloterror) | Thrown when an unrecognized engine slot is supplied. |
