symbol-sdk-typescript-javascript icon indicating copy to clipboard operation
symbol-sdk-typescript-javascript copied to clipboard

js-sha3 package

Open rg911 opened this issue 5 years ago • 4 comments

There's a defect reported for js-sha3 (https://github.com/emn178/js-sha3/pull/23) which can be a show stopper for some sdk users. The maintenance circle on js-sha3 seems slow. We can perhaps look for alternative libraries (e.g. https://www.npmjs.com/package/sha3) if it cannot be rectified in a timely manner

@fboucquez

rg911 avatar Jul 07 '20 14:07 rg911

A note for anyone hitting this, I had this issue when running tests in jest:

input is invalid type
      at Keccak.Object.<anonymous>.Keccak.update (node_modules/js-sha3/src/sha3.js:200:19)
      at Object.<anonymous>.exports.generateNamespaceId (node_modules/symbol-sdk/src/core/format/Utilities.ts:130:10)

But it works outside of Jest. It is not a solution but is a workaround if you need one.

codebru avatar Aug 28 '20 17:08 codebru

This is my workaround for the problem. npm install https://github.com/Propine/js-sha3.git

44uk avatar Feb 10 '21 15:02 44uk

I applied the solution shared by @44uk , and it worked well. I just needed to delete the node_modules folder and yarn install again.

I'm using jest for testing with TypeScript

aleixmorgadas avatar Apr 25 '21 11:04 aleixmorgadas

How's it going? My workaround is seems to be better npm install Propine/js-sha3#5ae72e8b than previous.

44uk avatar May 22 '21 10:05 44uk