2.8 KiB
@suaveplan/crypto-utils
Shared cryptographic utilities consumed internally by all other @suaveplan/crypto-* packages. Provides the low-level primitives that every crypto implementation needs but that belong in one place: multi-alphabet encoding (toHex/fromHex, toBase64/fromBase64, toBase64Url, toBase58/fromBase58); byte helpers (concatBytes, xor, i2osp/os2ip for integer-to-octet-string conversions); constantTimeEqual for timing-safe comparisons; randomBytes with an injectable ByteSource; zeroize for wiping key material; Merkle tree helpers (merkleRoot, merkleProof, verifyMerkleProof); a PrimitiveId registry and PrimitiveNotImplemented sentinel error; and KAT/differential-fuzz harnesses (runVectors, diffFuzz) used in every crypto primitive's test suite. Zero runtime crypto dependencies — this package provides helpers only, not cryptographic algorithms. Application code should generally import from @suaveplan/crypto or @suaveplan/crypto-hash; import from this package only when building a new cryptographic primitive or engine adapter.
When to use this skill
- Implementing or debugging code that imports
@suaveplan/crypto-utils. - The task touches: see package README.
- You need API guidance for this package's exports.
Quick reference
import { /* see API Reference below */ } from "@suaveplan/crypto-utils";
Dependencies
Workspace dependencies: @suaveplan/bytes, @suaveplan/error, @suaveplan/types
Where to read more
This skill is intentionally short. The package's own documentation is the authoritative source — read these in order:
packages/crypto/crypto-utils/README.md— overview, install, quick-start, module indexpackages/crypto/crypto-utils/src/**/*.md— co-located docs per implementation file (Purpose, Features, Basic + Advanced examples, full API reference, Implementation notes — all packages ship ≥200 words per module)packages/crypto/crypto-utils/package.jsonexportsmap — every subpath you can import from
When the user asks an API question, read the relevant co-located .md first; do not answer from training-data memory.
See also
@suaveplan/bytes@suaveplan/error@suaveplan/types
This SKILL.md is auto-generated by suaveplan-skills/scripts/generate-skills.ts from the package's README. Do not edit by hand — re-run the generator after the README changes.