webpack
Advanced tools
Comparing version 4.46.0 to 4.47.0
@@ -7,3 +7,2 @@ /* | ||
const crypto = require("crypto"); | ||
const SortableSet = require("../util/SortableSet"); | ||
@@ -15,2 +14,3 @@ const GraphHelpers = require("../GraphHelpers"); | ||
const contextify = require("../util/identifier").contextify; | ||
const createHash = require("../util/createHash"); | ||
@@ -26,4 +26,3 @@ /** @typedef {import("../Compiler")} Compiler */ | ||
const hashFilename = name => { | ||
return crypto | ||
.createHash("md4") | ||
return createHash("md4") | ||
.update(name) | ||
@@ -30,0 +29,0 @@ .digest("hex") |
@@ -34,3 +34,5 @@ /* | ||
const onRenderWithEntry = (source, chunk, hash) => { | ||
const externals = chunk.getModules().filter(m => m.external); | ||
const externals = chunk | ||
.getModules() | ||
.filter(m => m.external && m.externalType === "system"); | ||
@@ -37,0 +39,0 @@ // The name this bundle should be registered as with System |
@@ -32,5 +32,2 @@ /* | ||
exports.Hash = Hash; | ||
/** @typedef {typeof Hash} HashConstructor */ | ||
class BulkUpdateDecorator extends Hash { | ||
@@ -122,2 +119,12 @@ /** | ||
/** @type {typeof import("crypto") | undefined} */ | ||
let crypto = undefined; | ||
/** @type {typeof import("./hash/md4") | undefined} */ | ||
let createMd4 = undefined; | ||
/** @type {typeof import("./hash/BatchedHash") | undefined} */ | ||
let BatchedHash = undefined; | ||
/** @type {number} */ | ||
const NODE_MAJOR_VERSION = parseInt(process.versions.node, 10); | ||
/** | ||
@@ -132,2 +139,3 @@ * Creates a hash by name or function | ||
} | ||
switch (algorithm) { | ||
@@ -137,5 +145,34 @@ // TODO add non-cryptographic algorithm here | ||
return new DebugHash(); | ||
case "md4": | ||
if (NODE_MAJOR_VERSION >= 18) { | ||
if (createMd4 === undefined) { | ||
createMd4 = require("./hash/md4"); | ||
if (BatchedHash === undefined) { | ||
BatchedHash = require("./hash/BatchedHash"); | ||
} | ||
} | ||
return new /** @type {typeof import("./hash/BatchedHash")} */ (BatchedHash)( | ||
createMd4() | ||
); | ||
} | ||
// If we are on Node.js < 18, fall through to the default case | ||
// eslint-disable-next-line no-fallthrough | ||
case "native-md4": | ||
if (NODE_MAJOR_VERSION >= 18) { | ||
if (crypto === undefined) crypto = require("crypto"); | ||
return new BulkUpdateDecorator( | ||
/** @type {typeof import("crypto")} */ (crypto).createHash("md4") | ||
); | ||
} | ||
// If we are on Node.js < 18, fall through to the default case | ||
// eslint-disable-next-line no-fallthrough | ||
default: | ||
return new BulkUpdateDecorator(require("crypto").createHash(algorithm)); | ||
if (crypto === undefined) crypto = require("crypto"); | ||
return new BulkUpdateDecorator(crypto.createHash(algorithm)); | ||
} | ||
}; | ||
module.exports.Hash = Hash; | ||
/** @typedef {typeof Hash} HashConstructor */ |
{ | ||
"name": "webpack", | ||
"version": "4.46.0", | ||
"version": "4.47.0", | ||
"author": "Tobias Koppers @sokra", | ||
@@ -5,0 +5,0 @@ "description": "Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.", |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
1487784
361
46528
22