crypto
crypto copied to clipboard
IE 11 syntax error Expected ';'
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?
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.
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.
UPDATE: yes, commit https://github.com/chrisveness/crypto/blob/8ee96a/sha3.js works well in IE 11