(algo)
| 20 | const anyGlobal = getGlobal(); |
| 21 | const crypto = anyGlobal.crypto || anyGlobal.msCrypto; |
| 22 | export 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 | } |
| 29 | export function createHmac(_algo, key) { |
| 30 | const algo = ({ sha256, sha512 }[_algo]); |
| 31 | assertArgument(algo != null, "invalid hmac algorithm", "algorithm", _algo); |
no test coverage detected