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

js-sha512

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-sha512

This is a simple SHA-512, SHA-384, SHA-512/224, SHA-512/256 hash functions for JavaScript supports UTF-8 encoding.

  • 0.9.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is js-sha512?

The js-sha512 npm package is a JavaScript implementation of the SHA-512 hash function. It allows you to generate SHA-512 hashes for strings, arrays, and array buffers. This package is useful for cryptographic applications, data integrity checks, and more.

What are js-sha512's main functionalities?

Hashing a String

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

const sha512 = require('js-sha512');
const hash = sha512('Hello, World!');
console.log(hash);

Hashing an Array

This feature allows you to generate a SHA-512 hash from an array of bytes. The code sample demonstrates how to hash the array [0x61, 0x62, 0x63] and print the resulting hash.

const sha512 = require('js-sha512');
const hash = sha512.array([0x61, 0x62, 0x63]);
console.log(hash);

Hashing an ArrayBuffer

This feature allows you to generate a SHA-512 hash from an ArrayBuffer. The code sample demonstrates how to hash an ArrayBuffer containing the bytes [0x61, 0x62, 0x63] and print the resulting hash.

const sha512 = require('js-sha512');
const buffer = new ArrayBuffer(3);
const view = new Uint8Array(buffer);
view[0] = 0x61;
view[1] = 0x62;
view[2] = 0x63;
const hash = sha512.arrayBuffer(buffer);
console.log(hash);

Other packages similar to js-sha512

Keywords

FAQs

Package last updated on 24 Jan 2024

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