-
Notifications
You must be signed in to change notification settings - Fork 95
Description
I am currently unable to use react-native-crypto because randombytes throws this null error.
I am using an ejected Expo, SDK35, and all steps followed from react-native-crypto
I have linked correctly, used rn-nodeify and imported the shim file and still it is not working.
I have tried possibly all combinations of steps and procedures for installations and none of them seem to work for the latest expo/react-native sdks.
It has to do with this section of code
let sjcl = require('sjcl')
`let RNRandomBytes = require('react-native').NativeModules.RNRandomBytes
function noop () {}
function toBuffer (nativeStr) {
return new Buffer(nativeStr, 'base64')
}
function init () {
if (RNRandomBytes.seed) {
let seedBuffer = toBuffer(RNRandomBytes.seed)
addEntropy(seedBuffer)
} else {
seedSJCL()
}
}The error is line 15 if (RNRandomBytes.seed)` meaning that it never gets initialized somehow