Skip to content
Examples

Examples

Worker-safe bearer-key generation and hashing primitives

The crypto tests cover hashing, prefixed generation, and the key/digest pair. The grants and key-store tests cover issuance, verification, compare-and-swap grant edits and replay, authority-change fencing, a stale captured principal, revocation, optional expiry, owner suspension, the per-key rate limit, bounded sub-issuance and bounded grant edits, and admitUse on an expired or suspended key, run through the exact same assertions against two backends: a real Cloudflare Durable Object (pnpm run test:cloudflare, real state.storage.sql and transactionSync, not an adapter standing in for them) and the package’s own node:sqlite adapter (pnpm run test:node). Run everything with:

TERMINAL
pnpm --filter @fungi.computer/ear-tag test