We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e93a9c8 commit 33db1ceCopy full SHA for 33db1ce
hash.js
@@ -13,18 +13,7 @@ function Hash(blockSize, finalSize) {
13
14
Hash.prototype.update = function (data, enc) {
15
/* eslint no-param-reassign: 0 */
16
- if (data instanceof Uint8Array) {
17
- /*
18
- * Fast path
19
- * Already single-byte wide and 0-255
20
- */
21
- } else if (typeof data === 'string') {
22
- enc = enc || 'utf8';
23
- data = Buffer.from(data, enc);
24
- } else {
25
26
- data = toBuffer(data, enc);
27
- }
+ data = toBuffer(data, enc || 'utf8');
28
29
var block = this._block;
30
var blockSize = this._blockSize;
0 commit comments