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

universal-sha256-js

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

universal-sha256-js

An ultra lightweight 2kb JavaScript SHA256 cryptographic hash function (Node.js + Browsers).

  • 1.0.0-rc.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

SHA256-js

An ultra lightweight JavaScript SHA256 cryptographic hash function.

  • ~2 kB (minifeied + gzipped) to bundle

Setup

npm i sha256-js

Support

  • Node.js >16
  • Browser defaults, no IE 11

API

function sha256

Universal sha256 message digest helper function.

ParameterTypeDescription
dataUint8ArrayBinary data to hash.

Returns: Uint8Array — Message digest.

Examples

Ways to import.

import { sha256 } from 'sha256-js'

Ways to require.

const { sha256 } = require('sha256-js')

Usage sha256 in node.

const array = Uint8Array.from(
  Buffer.from('The quick brown fox jumped over the lazy dog')
)

sha256(array).then(console.log)

The logged output is [215, …, 146 ]

Keywords

FAQs

Package last updated on 14 Oct 2022

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