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

sha1

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sha1

native js function for hashing messages with SHA-1

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is sha1?

The sha1 npm package is a simple utility for generating SHA-1 hashes. It is commonly used for creating unique identifiers, checksums, and for cryptographic purposes where SHA-1 is still considered acceptable.

What are sha1's main functionalities?

Generate SHA-1 Hash

This feature allows you to generate a SHA-1 hash from a given input string. The code sample demonstrates how to import the sha1 package, generate a hash from the string 'Hello, World!', and print the resulting hash.

const sha1 = require('sha1');
const hash = sha1('Hello, World!');
console.log(hash); // Output: '2ef7bde608ce5404e97d5f042f95f89f1c232871'

Hashing Buffers

This feature allows you to generate a SHA-1 hash from a Buffer object. The code sample demonstrates how to create a Buffer from the string 'Hello, World!', generate a hash from the buffer, and print the resulting hash.

const sha1 = require('sha1');
const buffer = Buffer.from('Hello, World!');
const hash = sha1(buffer);
console.log(hash); // Output: '2ef7bde608ce5404e97d5f042f95f89f1c232871'

Other packages similar to sha1

FAQs

Package last updated on 26 May 2015

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