Rya*_*yan 5 cryptojs reactjs create-react-app
我使用生成了一个应用程序create-react-app,我想使用
crypto-js
我收到以下错误
crypto.sha256() is not a function
你必须使用安装crypto-js
npm install crypto-js
Run Code Online (Sandbox Code Playgroud)
在你的 js 文件中,你必须导入你想要使用的模块
import sha256 from 'crypto-js/sha256';
Run Code Online (Sandbox Code Playgroud)
现在你可以使用这些功能
sha256(nonce + message);
Run Code Online (Sandbox Code Playgroud)
你必须做定义message,并nonce在此之前
| 归档时间: |
|
| 查看次数: |
19502 次 |
| 最近记录: |