emn178 / js-sha3

A simple SHA-3 / Keccak hash function for JavaScript supports UTF-8 encoding.
MIT License
350 stars 85 forks source link

fix: don't modify global Array and ArrayBuffer prototypes #33

Closed legobeat closed 1 year ago

legobeat commented 1 year ago

This removes the injection of Array.isArray and ArrayBuffer.isView into globals and restricts the use of the polyfills to js-sha3 itself.

I noticed there seems to be some redundancy in the detection for ArrayBuffer.isView. This is not changed here, with the intent to keep logic changes at a minimum in this PR.

This was merged as part of #34