MCPcopy
hub / github.com/webpack/webpack / digest

Method digest

lib/util/hash/BatchedHash.js:101–113  ·  view source on GitHub ↗

* Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding} * @param {Encoding=} encoding encoding of the return value * @returns {string | Buffer} digest

(encoding)

Source from the content-addressed store, hash-verified

99 * @returns {string | Buffer} digest
100 */
101 digest(encoding) {
102 if (this.string !== undefined) {
103 if (this.encoding) {
104 update(this.hash, this.string, this.encoding);
105 } else {
106 update(this.hash, this.string);
107 }
108 }
109 if (!encoding) {
110 return digest(this.hash);
111 }
112 return digest(this.hash, encoding);
113 }
114}
115
116module.exports = BatchedHash;

Callers

nothing calls this directly

Calls 2

digestFunction · 0.85
updateFunction · 0.70

Tested by

no test coverage detected