MCPcopy Index your code
hub / github.com/nodejs/node / ensureSHA

Function ensureSHA

lib/internal/crypto/webidl.js:70–76  ·  view source on GitHub ↗

* @param {string | object} V - The hash algorithm identifier (string or object). * @param {string} label - The dictionary name for the error message.

(V, label)

Source from the content-addressed store, hash-verified

68 * @param {string} label - The dictionary name for the error message.
69 */
70function ensureSHA(V, label) {
71 const name = typeof V === 'string' ? V : V.name;
72 if (typeof name !== 'string' ||
73 !StringPrototypeStartsWith(StringPrototypeToLowerCase(name), 'sha'))
74 throw lazyDOMException(
75 `Only SHA hashes are supported in ${label}`, 'NotSupportedError');
76}
77
78converters.AlgorithmIdentifier = (V, opts) => {
79 // Union for (object or DOMString)

Callers 1

webidl.jsFile · 0.85

Calls 1

lazyDOMExceptionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…