MCPcopy
hub / github.com/webpack/webpack / computeIntegrity

Function computeIntegrity

lib/schemes/HttpUriPlugin.js:124–129  ·  view source on GitHub ↗
(content)

Source from the content-addressed store, hash-verified

122 * @returns {string} integrity
123 */
124const computeIntegrity = (content) => {
125 const hash = createHash("sha512");
126 hash.update(content);
127 const integrity = `sha512-${hash.digest("base64")}`;
128 return integrity;
129};
130
131/**
132 * Returns true, if integrity matches.

Callers 3

verifyIntegrityFunction · 0.85
fetchContentRawMethod · 0.85
applyMethod · 0.85

Calls 3

createHashFunction · 0.85
updateMethod · 0.45
digestMethod · 0.45

Tested by

no test coverage detected