You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

simple-sha256

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-sha256

Generate SHA-256 hashes (in Node and the Browser)

1.1.0
latest
Source
npmnpm
Version published
Weekly downloads
17K
7.27%
Maintainers
1
Weekly downloads
 
Created
Source

simple-sha256 travis npm downloads javascript style guide

Generate SHA-256 hashes (in Node and the Browser)

In Node.js, this package uses crypto.createHash(). In the browser, it uses crypto.subtle.digest().

install

npm install simple-sha256

usage

Async (returns a Promise):

const sha256 = require('simple-sha256')

init()

async function init () {
  const hash = await sha256('hey there')
  console.log(hash)
  // 74ef874a9fa69a86e091ea6dc2668047d7e102d518bebed19f8a3958f664e3da
}

Sync:

const sha256 = require('simple-sha256')
console.log(sha256.sync('hey there'))
// 74ef874a9fa69a86e091ea6dc2668047d7e102d518bebed19f8a3958f664e3da

see also

  • simple-sha1

license

MIT. Copyright (c) Feross Aboukhadijeh.

Keywords

browser

FAQs

Package last updated on 06 Jan 2021

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.