MCPcopy
hub / github.com/webpack/webpack / update

Method update

lib/util/hash/wasm-hash.js:76–95  ·  view source on GitHub ↗

* Update hash https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding * @param {string | Buffer} data data * @param {string=} inputEncoding data encoding * @returns {this} updated hash

(data, inputEncoding)

Source from the content-addressed store, hash-verified

74 * @returns {this} updated hash
75 */
76 update(data, inputEncoding) {
77 if (typeof data === "string") {
78 while (data.length > MAX_SHORT_STRING) {
79 this._updateWithShortString(
80 data.slice(0, MAX_SHORT_STRING),
81 /** @type {NodeJS.BufferEncoding} */
82 (inputEncoding)
83 );
84 data = data.slice(MAX_SHORT_STRING);
85 }
86 this._updateWithShortString(
87 data,
88 /** @type {NodeJS.BufferEncoding} */
89 (inputEncoding)
90 );
91 return this;
92 }
93 this._updateWithBuffer(data);
94 return this;
95 }
96
97 /**
98 * Update with short string.

Callers 3

_updateWithBufferMethod · 0.45
updateFunction · 0.45

Calls 3

_updateWithBufferMethod · 0.95
sliceMethod · 0.80

Tested by

no test coverage detected