Skip to content

null is not an object (evaluating RNRandomBytes.seed) #40

Description

@JUDOKICK

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions