expo-random provides a native interface for creating strong random bytes. With Random you can create values equivalent to Node.js core crypto.randomBytes API.
Generates completely random bytes using native implementations. The byteCount property is a number indicating the number of bytes to generate in the form of a Uint8Array.
Parameters
Name
Type
Description
byteCount
number
A number within the range: 0...1024. Anything else will throw a TypeError
Returns
Name
Type
Description
randomBytes
Promise<Uint8Array>
An array of random bytes with the same length as the byteCount