Socket
Socket
Sign inDemoInstall

sha

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sha

Check and get file hashes


Version published
Weekly downloads
158K
decreased by-0.9%
Maintainers
1
Weekly downloads
 
Created

What is sha?

The 'sha' npm package is used for generating SHA (Secure Hash Algorithm) hashes. It supports various SHA algorithms like SHA-1, SHA-256, SHA-384, and SHA-512. This package is useful for creating cryptographic hashes of data, which can be used for data integrity checks, password hashing, and more.

What are sha's main functionalities?

Generate SHA-1 Hash

This feature allows you to generate a SHA-1 hash of a given input string. The code sample demonstrates how to create a SHA-1 hash of the string 'Hello World' and output it in hexadecimal format.

const sha = require('sha');
const hash = sha('sha1').update('Hello World').digest('hex');
console.log(hash);

Generate SHA-256 Hash

This feature allows you to generate a SHA-256 hash of a given input string. The code sample demonstrates how to create a SHA-256 hash of the string 'Hello World' and output it in hexadecimal format.

const sha = require('sha');
const hash = sha('sha256').update('Hello World').digest('hex');
console.log(hash);

Generate SHA-384 Hash

This feature allows you to generate a SHA-384 hash of a given input string. The code sample demonstrates how to create a SHA-384 hash of the string 'Hello World' and output it in hexadecimal format.

const sha = require('sha');
const hash = sha('sha384').update('Hello World').digest('hex');
console.log(hash);

Generate SHA-512 Hash

This feature allows you to generate a SHA-512 hash of a given input string. The code sample demonstrates how to create a SHA-512 hash of the string 'Hello World' and output it in hexadecimal format.

const sha = require('sha');
const hash = sha('sha512').update('Hello World').digest('hex');
console.log(hash);

Other packages similar to sha

FAQs

Package last updated on 28 Apr 2013

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