crypto icon indicating copy to clipboard operation
crypto copied to clipboard

IE 11 syntax error Expected ';'

Open nolimitdev opened this issue 4 years ago • 3 comments

Hi, im building app.js with webpack and in IE 11 I got error Expected ';' for this line state[x][y] = 0n; of sha3.js. I tried to include @babel/plugin-syntax-bigint but it still does not work. Could you please advise how to fix it?

nolimitdev avatar Sep 04 '20 08:09 nolimitdev

I have very little experience of using Babel – I take it you are following the usage from babeljs.io/docs/en/babel-plugin-syntax-bigint?

I suggest you either raise it with the author of plugin-syntax-bigint, or else commit 8ee96a uses a Long class to emulate an unsigned 64-bit integer, which may work in IE.

Note that this code is a reference implementation intended primarily for study purposes rather than for production use: it has a good test suite, but I can provide no guarantees of cryptographic security.

chrisveness avatar Sep 05 '20 12:09 chrisveness

There are many use cases that we do not need complex well known lib. In my case I just want to use your lib to get fingerprint of some JSON stringified data using sha3-256 and fingerprint will be used as cache key - so no important critical feature. Your lib minified means +3kB to final bundle and for example this lib https://www.npmjs.com/package/js-sha3 minified +10kB. Im sure I have implemented @babel/plugin-syntax-bigint correctly. I have tried to use it via file .babelrc or webpack.config.js too but it still does not work. I do not know why.

nolimitdev avatar Sep 07 '20 11:09 nolimitdev

UPDATE: yes, commit https://github.com/chrisveness/crypto/blob/8ee96a/sha3.js works well in IE 11

nolimitdev avatar Sep 07 '20 13:09 nolimitdev