Install jsSHA
masterDepending on your environment, you can install or include jsSHA as follows:
Browser
Include the desired JavaScript file in your HTML header:
<script type="text/javascript" src="/path/to/sha.js"></script>Node.js
Install via npm:
npm install jsshaTo use it, you can require the full module or specific variants (using subpath exports in Node.js v13+):
const jsSHA = require("jssha");
const jsSHA1 = require("jssha/sha1");
// For older Node.js versions without subpath exports:
const jsSHA1 = require("jssha/dist/sha1");
// Using ESM (Node.js v13+):
import jsSHA from "jssha";Deno
Use the npm: import specifier:
import jsSHA from "npm:jssha";
import jsSHA1 from "npm:jssha/sha1";npm install jssha