MCPcopy
hub / github.com/webpack/webpack / _getModuleGraphHashBigInt

Method _getModuleGraphHashBigInt

lib/ChunkGraph.js:1795–1810  ·  view source on GitHub ↗

* Get module graph hash big int. * @param {ChunkGraphModule} cgm the ChunkGraphModule * @param {Module} module the module * @param {RuntimeSpec} runtime the runtime * @returns {bigint} hash as big int

(cgm, module, runtime)

Source from the content-addressed store, hash-verified

1793 * @returns {bigint} hash as big int
1794 */
1795 _getModuleGraphHashBigInt(cgm, module, runtime) {
1796 if (cgm.graphHashes === undefined) {
1797 cgm.graphHashes = new RuntimeSpecMap();
1798 }
1799 const graphHash = cgm.graphHashes.provide(runtime, () => {
1800 const hash = createHash(this._hashFunction);
1801 hash.update(`${cgm.id}${this.moduleGraph.isAsync(module)}`);
1802 const sourceTypes = this._getOverwrittenModuleSourceTypes(module);
1803 if (sourceTypes !== undefined) {
1804 for (const type of sourceTypes) hash.update(type);
1805 }
1806 this.moduleGraph.getExportsInfo(module).updateHash(hash, runtime);
1807 return BigInt(`0x${hash.digest("hex")}`);
1808 });
1809 return graphHash;
1810 }
1811
1812 /**
1813 * Get module graph hash with connections.

Callers 5

getModuleGraphHashMethod · 0.95
addModuleToHashMethod · 0.95
addModulesToHashMethod · 0.95

Calls 8

createHashFunction · 0.85
isAsyncMethod · 0.80
getExportsInfoMethod · 0.80
provideMethod · 0.45
updateMethod · 0.45
updateHashMethod · 0.45
digestMethod · 0.45

Tested by

no test coverage detected