1import { createHash } from "node:crypto";
2import * as Effect from "effect/Effect";
3
4/**
5 * MD5 hex digest of the given data. Wrapped in `Effect.sync` so the call
6 * participates in the Effect runtime (tracing/interruption) per the
7 * Effect-platform conventions.
8 */
9export const md5 = (data: string | Uint8Array): Effect.Effect<string> =>
10 Effect.sync(() => createHash("md5").update(data).digest("hex"));