MCPcopy
hub / github.com/webpack/webpack / getHash

Function getHash

lib/ModuleFilenameHelpers.js:84–90  ·  lib/ModuleFilenameHelpers.js::getHash
(strFn, hashFunction = DEFAULTS.HASH_FUNCTION)

Source from the content-addressed store, hash-verified

82 */
83const getHash =
84 (strFn, hashFunction = DEFAULTS.HASH_FUNCTION) =>
85 () => {
86 const hash = createHash(hashFunction);
87 hash.update(strFn());
88 const digest = hash.digest(class="st">"hex");
89 return digest.slice(0, 4);
90 };
91
92/**
93 * Returns the lazy access object.

Callers 1

Calls 4

createHashFunction · 0.85
sliceMethod · 0.80
updateMethod · 0.45
digestMethod · 0.45

Tested by

no test coverage detected