MCPcopy Create free account
hub / github.com/PageLeay/celestial-runtime / createHash

Function createHash

lib.esm/crypto/crypto-browser.js:22–28  ·  view source on GitHub ↗
(algo)

Source from the content-addressed store, hash-verified

20const anyGlobal = getGlobal();
21const crypto = anyGlobal.crypto || anyGlobal.msCrypto;
22export function createHash(algo) {
23 switch (algo) {
24 case "sha256": return sha256.create();
25 case "sha512": return sha512.create();
26 }
27 assertArgument(false, "invalid hashing algorithm name", "algorithm", algo);
28}
29export function createHmac(_algo, key) {
30 const algo = ({ sha256, sha512 }[_algo]);
31 assertArgument(algo != null, "invalid hmac algorithm", "algorithm", _algo);

Callers 4

_sha256Function · 0.90
_sha512Function · 0.90
_sha256Function · 0.90
_sha512Function · 0.90

Calls 1

assertArgumentFunction · 0.90

Tested by

no test coverage detected