mirror of
https://github.com/emn178/js-sha3.git
synced 2026-08-12 19:41:36 +08:00
Fix of recognition of ArrayBuffer parameters
If js-sha3 is loaded using 'webpack' loader then the top-most fuction is not called with global object (`global` in node, `window` in browsers) and thus `root.ArrayBuffer` is undefined. This patch introduces usage of `ArrayBuffer` without `root` prefix similary to how e.g. `Uint8Array` is already used.
This commit is contained in:
+1
-1
@@ -106,7 +106,7 @@
|
||||
|
||||
Keccak.prototype.update = function (message) {
|
||||
var notString = typeof message != 'string';
|
||||
if (notString && message.constructor == root.ArrayBuffer) {
|
||||
if (notString && message instanceof ArrayBuffer) {
|
||||
message = new Uint8Array(message);
|
||||
}
|
||||
var length = message.length, blocks = this.blocks, byteCount = this.byteCount,
|
||||
|
||||
Reference in New Issue
Block a user