Skip to content

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

@JUDOKICK

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

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