Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including expo-random with all npm packages installed. Try it out:

var expoRandom = require("expo-random")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

expo-random v9.0.0

Expo universal module for random bytes


Provides a native interface for creating strong random bytes. With Random you can create values equivalent to Node.js core crypto.randomBytes API.

Installation in managed Expo projects

For managed managed Expo projects, please follow the installation instructions in the API documentation for the latest stable release.

You can add a polyfill for crypto.getRandomValues by installing react-native-get-random-values and importing it in SDK 39 and higher.

Installation in bare React Native projects

Add the package to your npm dependencies

expo install expo-random

Configure for iOS

Run npx pod-install after installing the npm package.

Configure for Android

No additional set up necessary.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free