Reputation: 6327
I generated an app using create-react-app
and I want to use
crypto-js
I am getting the following error
crypto.sha256() is not a function
Upvotes: 12
Views: 53015
Reputation: 28189
You gotta install crypto-js using
npm install crypto-js
In your js files, you have to import module you wanna use
import sha256 from 'crypto-js/sha256';
Now you can use those functions
sha256(nonce + message);
You have do define message
and nonce
before this
Upvotes: 26