0

I trying the ethereumjs-util in react-native , first ethUtil.privateToPublic work fine, then when use ethUtil.publicToAddress will getting this error TypeError: Cannot read property 'call' of undefined , I trace the error actually come from Keccak.

Then I try Keccak it self :

const createKeccakHash = require('keccak');
console.log(createKeccakHash('keccak256').digest().toString('hex'));

also getting the same error TypeError: Cannot read property 'call' of undefined

FeelRightz
  • 2,777
  • 2
  • 38
  • 73

1 Answers1

1

You can try use js-sha3 I know that it maybe your module doesn't support React Native.

keccak256 = require('js-sha3').keccak256;
var bytes = keccak256.digest();
console.log(bytes);
hong developer
  • 13,291
  • 4
  • 38
  • 68