
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
@aws-sdk/hash-stream-node
Advanced tools
[](https://www.npmjs.com/package/@aws-sdk/hash-stream-node) [](https://www.npmjs.com/package/@aws
@aws-sdk/hash-stream-node is a package from the AWS SDK for JavaScript that provides utilities for hashing streams. It is particularly useful for creating hash digests of data streams, which is a common requirement when working with AWS services like S3 for data integrity checks.
Hashing a Stream
This feature allows you to create a hash digest of a data stream using a specified hashing algorithm (e.g., SHA-256). The code sample demonstrates how to read a file as a stream and generate its hash digest.
const { Hash } = require('@aws-sdk/hash-stream-node');
const { createReadStream } = require('fs');
const stream = createReadStream('path/to/file');
const hash = new Hash('sha256');
hash.update(stream);
hash.digest().then(digest => {
console.log('Hash digest:', digest);
});
The 'crypto' module is a built-in Node.js module that provides cryptographic functionality, including hashing. It can be used to hash streams, but it requires more manual setup compared to @aws-sdk/hash-stream-node. For example, you need to manually handle the stream events and update the hash accordingly.
The 'hash-stream' package is a third-party Node.js module that simplifies hashing streams. It provides a more straightforward API for hashing streams compared to the built-in 'crypto' module, but it may not be as tightly integrated with AWS services as @aws-sdk/hash-stream-node.
The 'stream-hash' package is another third-party module for hashing streams. It offers similar functionality to @aws-sdk/hash-stream-node but is more general-purpose and not specifically designed for AWS SDK integration.
A utility for calculating the hash of Node.JS readable streams.
An internal package
You probably shouldn't, at least directly.
3.374.0 (2023-07-20)
FAQs
[](https://www.npmjs.com/package/@aws-sdk/hash-stream-node) [](https://www.npmjs.com/package/@aws
The npm package @aws-sdk/hash-stream-node receives a total of 419,719 weekly downloads. As such, @aws-sdk/hash-stream-node popularity was classified as popular.
We found that @aws-sdk/hash-stream-node demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
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.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.