variable / @typed/id/_sha

sha1

Digests bytes with Web Crypto SHA-1 and returns a fresh Uint8Array.

Package version
1.0.0-beta.13
Category
Hashing
Since
1.0.0

Import

import { sha1 } from "@typed/id/_sha";

Signatures

export declare const sha1: (data: BufferSource) => Effect.Effect<Uint8Array<ArrayBuffer>, never, never>;

Why

This published low-level helper exposes the exact hash required by UUID version 5; SHA-1 here is identity derivation, not password or signature security. Missing Web Crypto and rejected subtle.digest promises are Effect defects because the typed error channel is never.

Ownership and lifetime

Each Effect owns one asynchronous Web Crypto request and transfers a fresh result buffer; it retains no input after completion.

Examples

import { sha1 } from "@typed/id/_sha"
import { Effect } from "effect"
const digest = Effect.runPromise(sha1(new TextEncoder().encode("name")))

Source