Skip to content

createDigestId

createDigestId<Brand>(brand, opts): DigestCodec<Brand>

Defined in: src/codecs/digest/index.ts:110

Construct a DigestCodec for brand.

opts.ns is the required namespace — the same material under a different ns yields a different ID. opts.key is the single operator Digest key; there is no keyring.

Brand extends string

Brand & ValidBrand<Brand>

DigestOptions

DigestCodec<Brand>

const key = await importDigestKey(new Uint8Array(32));
const idk = createDigestId("idk", { ns: "checkout", key });
const id = await idk.digest("order-123"); // Id<"idk">
idk.is(id); // true