@hyperttp/crypto
v1.0.2
Published
[Русский](./lang/ru/README.md)
Readme
@hyperttp/crypto
Cryptographic plugins for HyperTTP: HTTP Digest, HMAC request signing, signature verification, and replay protection.
Installation
npm install @hyperttp/crypto @hyperttp/typesQuick start
import { withCrypto } from "@hyperttp/crypto";
client.use(
withCrypto({
hmac: {
secret: process.env.HMAC_SECRET!,
nonceHeaderName: "x-nonce",
includeHeaders: ["digest", "content-type"],
},
}),
);withCrypto() without options creates a SHA-256 Digest header only. HMAC signing requires an explicit secret and must not be used with secrets exposed to browser or mobile bundles.
See the Russian documentation for API details, server-side verification, and atomic nonce storage requirements.
