Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@smithy/hash-node
Advanced tools
[![NPM version](https://img.shields.io/npm/v/@smithy/hash-node/latest.svg)](https://www.npmjs.com/package/@smithy/hash-node) [![NPM downloads](https://img.shields.io/npm/dm/@smithy/hash-node.svg)](https://www.npmjs.com/package/@smithy/hash-node)
@smithy/hash-node is an npm package designed to provide hashing utilities for Node.js applications. It is part of the Smithy framework, which is used for building SDKs and other tools. This package offers functionalities to create hash digests using various algorithms.
Creating SHA-256 Hash
This feature allows you to create a SHA-256 hash of a given input string. The code sample demonstrates how to initialize a SHA-256 hash, update it with a string, and then get the hexadecimal digest of the hash.
const { Hash } = require('@smithy/hash-node');
const hash = new Hash('sha256');
hash.update('Hello, World!');
const digest = hash.digest('hex');
console.log(digest);
Creating MD5 Hash
This feature allows you to create an MD5 hash of a given input string. The code sample shows how to initialize an MD5 hash, update it with a string, and then get the hexadecimal digest of the hash.
const { Hash } = require('@smithy/hash-node');
const hash = new Hash('md5');
hash.update('Hello, World!');
const digest = hash.digest('hex');
console.log(digest);
The 'crypto' module is a built-in Node.js module that provides cryptographic functionalities, including hashing. It supports various algorithms like SHA-256, MD5, and more. Compared to @smithy/hash-node, 'crypto' is more versatile and widely used but may not be as specialized for SDK development.
The 'hash.js' package is a JavaScript library that provides hash functions for various algorithms like SHA-256, SHA-512, and more. It is similar to @smithy/hash-node in terms of functionality but is more focused on providing a wide range of hash algorithms.
The 'bcrypt' package is used for hashing passwords and is known for its security features. While it provides hashing functionalities, it is more specialized for password hashing and security, unlike @smithy/hash-node, which is more general-purpose.
FAQs
[![NPM version](https://img.shields.io/npm/v/@smithy/hash-node/latest.svg)](https://www.npmjs.com/package/@smithy/hash-node) [![NPM downloads](https://img.shields.io/npm/dm/@smithy/hash-node.svg)](https://www.npmjs.com/package/@smithy/hash-node)
The npm package @smithy/hash-node receives a total of 13,351,748 weekly downloads. As such, @smithy/hash-node popularity was classified as popular.
We found that @smithy/hash-node demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.