package
Create and verify content digests as found in HTTP headers according to draft-ietf-httpbis-digest-headers
npm install httpbis-digest-headersGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Registry package owners.
Based on the draft specification for HTTP Digest Headers, this library facilitates the creation and verification of a Content-Digest header.
This is useful when verifying the content of a message body as part of signature verification.
The library currently only supports sha-256 and sha-512 algorithms
import { createContentDigestHeader } from 'httpbis-digest-headers';
request.setHeader('Content-Digest', await createContentDigestHeader(messageBody, ['SHA-256']))import { verifyContentDigest } from 'httpbis-digest-headers';
const server = http.createServer(async (req, res) => {
const buffers = [];
for await (const chunk of req) {
buffers.push(chunk);
}
const verified = await verifyContentDigest(Buffer.concat(buffers), req.getHeader('Content-Digest'))
});Estimated unpacked size across 2 packages.
142.9 kB
Includes dependencies.