55"use strict" ;
66
77const asyncLib = require ( "async" ) ;
8- const crypto = require ( "crypto" ) ;
98const util = require ( "util" ) ;
109const Tapable = require ( "tapable" ) ;
1110const EntryModuleNotFoundError = require ( "./EntryModuleNotFoundError" ) ;
@@ -25,6 +24,7 @@ const AsyncDependencyToInitialChunkWarning = require("./AsyncDependencyToInitial
2524const CachedSource = require ( "webpack-sources" ) . CachedSource ;
2625const Stats = require ( "./Stats" ) ;
2726const Semaphore = require ( "./util/Semaphore" ) ;
27+ const createHash = require ( "./util/createHash" ) ;
2828const Queue = require ( "./util/Queue" ) ;
2929const SortableSet = require ( "./util/SortableSet" ) ;
3030
@@ -1357,7 +1357,7 @@ class Compilation extends Tapable {
13571357 const hashFunction = outputOptions . hashFunction ;
13581358 const hashDigest = outputOptions . hashDigest ;
13591359 const hashDigestLength = outputOptions . hashDigestLength ;
1360- const hash = crypto . createHash ( hashFunction ) ;
1360+ const hash = createHash ( hashFunction ) ;
13611361 if ( outputOptions . hashSalt )
13621362 hash . update ( outputOptions . hashSalt ) ;
13631363 this . mainTemplate . updateHash ( hash ) ;
@@ -1369,7 +1369,7 @@ class Compilation extends Tapable {
13691369 const modules = this . modules ;
13701370 for ( let i = 0 ; i < modules . length ; i ++ ) {
13711371 const module = modules [ i ] ;
1372- const moduleHash = crypto . createHash ( hashFunction ) ;
1372+ const moduleHash = createHash ( hashFunction ) ;
13731373 module . updateHash ( moduleHash ) ;
13741374 module . hash = moduleHash . digest ( hashDigest ) ;
13751375 module . renderedHash = module . hash . substr ( 0 , hashDigestLength ) ;
@@ -1390,7 +1390,7 @@ class Compilation extends Tapable {
13901390 } ) ;
13911391 for ( let i = 0 ; i < chunks . length ; i ++ ) {
13921392 const chunk = chunks [ i ] ;
1393- const chunkHash = crypto . createHash ( hashFunction ) ;
1393+ const chunkHash = createHash ( hashFunction ) ;
13941394 if ( outputOptions . hashSalt )
13951395 chunkHash . update ( outputOptions . hashSalt ) ;
13961396 chunk . updateHash ( chunkHash ) ;
@@ -1413,7 +1413,7 @@ class Compilation extends Tapable {
14131413 const hashFunction = outputOptions . hashFunction ;
14141414 const hashDigest = outputOptions . hashDigest ;
14151415 const hashDigestLength = outputOptions . hashDigestLength ;
1416- const hash = crypto . createHash ( hashFunction ) ;
1416+ const hash = createHash ( hashFunction ) ;
14171417 hash . update ( this . fullHash ) ;
14181418 hash . update ( update ) ;
14191419 this . fullHash = hash . digest ( hashDigest ) ;
0 commit comments