Socket
Socket
Sign inDemoInstall

expo-random

Package Overview
Dependencies
635
Maintainers
26
Versions
68
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    expo-random

Expo universal module for random bytes


Version published
Weekly downloads
96K
decreased by-8.75%
Maintainers
26
Install size
73.0 MB
Created
Weekly downloads
 

Readme

Source

expo-random

⚠️ Deprecated

This package is now deprecated in favor of expo-crypto, which provides the same functionality. To migrate, replace all imports from expo-random with imports from expo-crypto.

Provides a native interface for creating strong random bytes. With Random you can generate random values to address use cases that other APIs like the web's crypto.getRandomValues and Node's crypto.randomBytes might address.

Installation in managed Expo projects

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

You can add a polyfill for the web's crypto.getRandomValues by installing expo-standard-web-crypto and importing it in SDK 39 and higher:

import { polyfillWebCrypto } from 'expo-standard-web-crypto';

polyfillWebCrypto();
// crypto.getRandomValues is now globally defined

Other libraries like react-native-get-random-values may work too.

Installation in bare React Native projects

For bare React Native projects, you must ensure that you have installed and configured the expo package before continuing.

Add the package to your npm dependencies

npx expo install expo-random

Configure for iOS

Run npx pod-install after installing the npm package.

Configure for Android

No additional set up necessary.

Keywords

FAQs

Last updated on 14 Nov 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc