Skip to content

Ear Tag

Random bearer keys and SHA-256 digests, a typed capability-grant vocabulary, and a tenant-scoped key store with issuance, verification and lifecycle, for services issuing invite codes or API keys.

  • @fungi.computer/ear-tag
  • v0.1.0
  • MIT

Fastest path

  1. Install

    Add it to your project with npm, pnpm, Yarn or Bun.

    TERMINAL
    npm install @fungi.computer/ear-tag
  2. Issue a key and its digest

    Creates a prefixed bearer key and its SHA-256 digest in one call, then prints that the key carries the prefix and the digest is 64 hex characters.

    home.ts
    import { generateKeyAndHash } from "@fungi.computer/ear-tag";
    const { key, digest } = await generateKeyAndHash({ prefix: "invite" });
    console.log(key.startsWith("invite_")); // true
    console.log(digest.length); // 64: a SHA-256 digest as lowercase hex