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

boring-webcrypto-sha256

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

boring-webcrypto-sha256

A tiny (<10 line) function that uses webcrypto to get a SHA256 hash of a string.

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
505
increased by44.7%
Maintainers
1
Weekly downloads
 
Created
Source

boring-webcrypto-sha256

A quick (< 10 lines) version of MDNs function to get the SHA256 hash of a string

Quick reminder that I am a strange person on the internet

Read the code, check it's correct, compare it to MDN version, make sure the built version is the same, and compare with the Linux command line to ensure you get the same output:

echo -n 'someInput' | sha256sum

Usage

npm i boring-webcrypto-sha256

Then just:

import { getSHA256Hash } from "./sha256";

and

const hash = await getSHA256Hash('someInput')

That's all.

FAQs

Package last updated on 28 Apr 2023

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