Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

httpbis-digest-headers

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

httpbis-digest-headers

Create and verify content digests as found in HTTP headers according to draft-ietf-httpbis-digest-headers

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
605
increased by7.46%
Maintainers
1
Weekly downloads
 
Created
Source

HTTP Digest Headers

Node.js CI

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.

Specifications

The library currently only supports sha-256 and sha-512 algorithms

Examples

Creating a digest header

import { createContentDigestHeader } from 'httpbis-digest-headers';
request.setHeader('Content-Digest', createContentDigestHeader(messageBody, ['sha-256']))

Verify a digest header

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 = verifyContentDigest(Buffer.concat(buffers), req.getHeader('Content-Digest'))
});```

Keywords

FAQs

Package last updated on 27 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc