我使用create-react-app
生成了一个应用程序,我想使用crypto-js我收到以下错误
crypto.sha256() is not a function
你必须使用安装crypto-js
npm install crypto-js
在你的js文件中,你必须导入你想要使用的模块
import sha256 from 'crypto-js/sha256';
现在您可以使用这些功能了
sha256(nonce + message);
在此之前你已经定义了message
和nonce