Skip to content

Commit 33db1ce

Browse files
committed
cleaner
1 parent e93a9c8 commit 33db1ce

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

hash.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,7 @@ function Hash(blockSize, finalSize) {
1313

1414
Hash.prototype.update = function (data, enc) {
1515
/* 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-
enc = enc || 'utf8';
26-
data = toBuffer(data, enc);
27-
}
16+
data = toBuffer(data, enc || 'utf8');
2817

2918
var block = this._block;
3019
var blockSize = this._blockSize;

0 commit comments

Comments
 (0)