MCPcopy
hub / github.com/webpack/webpack / isSupportedDigest

Function isSupportedDigest

lib/TemplatedPathPlugin.js:114–119  ·  view source on GitHub ↗
(digest)

Source from the content-addressed store, hash-verified

112 * @returns {boolean} whether a hash can be re-encoded into this digest
113 */
114const isSupportedDigest = (digest) => {
115 if (digest === "base64url" || digest === "base64safe") return true;
116 const base = BASE_DIGEST.exec(digest);
117 if (base) return base[1] === "64" || SUPPORTED_BASES.has(base[1]);
118 return Buffer.isEncoding(digest);
119};
120
121/**
122 * Decodes an already-digested hash string back into its raw bytes.

Callers 1

reEncodeDigestFunction · 0.85

Calls 2

execMethod · 0.80
hasMethod · 0.45

Tested by

no test coverage detected