Skip to content

no PRNG in react-native #252

Answered by dchest
shin101004 asked this question in Q&A
Discussion options

You must be logged in to vote

Yeah, since react-native doesn't have crypto.randomBytes or window.getRandomValues, you need to supply your own synchronous PRNG with nacl.setPRNG or use a polyfill, for example this module https://www.npmjs.com/package/react-native-get-random-values (note: I haven't verified if it's correctly and securely implemented).

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dchest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #251 on March 15, 2023 13:31.