How to generate a SHA-256 hash with JavaScript
Aug 30, 2021
This article goes over how to generate a SHA-256 hexadecimal hash using Node.js and JavaScript in the browser.
Node.js
To generate a SHA-256 hash in Node.js using crypto:
Usage:
Browser
To generate a SHA-256 hash in the browser using SubtleCrypto:
Or written in async/await:
Usage: