我尝试了ethereumjs-util
,react-native
首先ethUtil.privateToPublic
工作正常,然后在使用时ethUtil.publicToAddress
会收到此错误TypeError: Cannot read property 'call' of undefined
,我跟踪错误实际上来自Keccak
。
然后我自己尝试Keccak:
const createKeccakHash = require('keccak');
console.log(createKeccakHash('keccak256').digest().toString('hex'));
也得到同样的错误TypeError: Cannot read property 'call' of undefined