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

create-hash

Package Overview
Dependencies
Maintainers
5
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-hash

create hashes for browserify

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10M
decreased by-4.48%
Maintainers
5
Weekly downloads
 
Created

What is create-hash?

The create-hash npm package is a utility for creating hash digests of data. It implements the Node.js crypto.createHash API in pure JavaScript, making it compatible with environments where Node's native crypto module is not available. This package supports various hashing algorithms, such as SHA-1, SHA-256, and MD5, allowing users to generate fixed-size hash outputs from input data. It is commonly used for creating unique identifiers, checksums, or for password hashing and data integrity verification.

What are create-hash's main functionalities?

Creating a SHA-256 hash

This code demonstrates how to create a SHA-256 hash of the string 'hello world'. It uses the 'create-hash' package to create a hash object, updates the hash with the input data, and then outputs the digest in hexadecimal format.

"use strict";\nconst createHash = require('create-hash');\nconst hash = createHash('sha256');\nhash.update('hello world');\nconsole.log(hash.digest('hex'));

Creating an MD5 hash

This example shows how to generate an MD5 hash of the string 'example data'. Similar to the previous example, it creates an MD5 hash object, updates it with the input, and outputs the resulting digest in hex format.

"use strict";\nconst createHash = require('create-hash');\nconst hash = createHash('md5');\nhash.update('example data');\nconsole.log(hash.digest('hex'));

Other packages similar to create-hash

Keywords

FAQs

Package last updated on 11 Apr 2018

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