# react-native-get-random-values-fork

> A small implementation of `getRandomValues` for React Native.

Latest version **1.1.3** (published 2019-11-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-get-random-values-fork
pnpm add react-native-get-random-values-fork
yarn add react-native-get-random-values-fork
bun add react-native-get-random-values-fork
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2019-11-09 |
| First published | 2019-11-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 15.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | hzz780 |
| Keywords | Crypto.getRandomValues, crypto, get-random-values, getRandomValues, polyfill, react-native, LinusU/react-native-get-random-values |

## Links

- npm: https://www.npmjs.com/package/react-native-get-random-values-fork
- Repository: https://github.com/hzz780/react-native-get-random-values
- Homepage: https://github.com/hzz780/react-native-get-random-values#readme
- Issues: https://github.com/hzz780/react-native-get-random-values/issues
- npm.io page: https://npm.io/package/react-native-get-random-values-fork

## Dependencies (1)

- [fast-base64-decode](https://npm.io/package/fast-base64-decode.md) ^1.0.0

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 1.1.3 (latest) — 2019-11-09
- 1.1.2 — 2019-11-09
- 1.1.1 — 2019-11-09

## README

# `getRandomValues` for React Native

A small implementation of `getRandomValues` for React Native.

## Installation

```sh
# RN >= 0.6
npm install --save react-native-get-random-values
cd ios
pod install
```

```sh
# RN <0.6
npm install --save react-native-get-random-values
react-native link react-native-get-random-values
```

## Usage

This library works as a polyfill for the global `crypto.getRandomValues`.

```javascript
// Add this line to your `index.js`
import 'react-native-get-random-values'
```

## API

### `crypto.getRandomValues(typedArray)`

The `crypto.getRandomValues()` method lets you get cryptographically strong random values. The array given as the parameter is filled with random numbers (random in its cryptographic meaning).

To guarantee enough performance, implementations are not using a truly random number generator, but they are using a pseudo-random number generator *seeded* with a value with enough entropy. The PRNG used differs from one implementation to the other but is suitable for cryptographic usages. Implementations are also required to use a seed with enough entropy, like a system-level entropy source.

- `typedArray` - Is an integer-based TypedArray, that is an `Int8Array`, a `Uint8Array`, an `Int16Array`, a `Uint16Array`, an `Int32Array`, or a `Uint32Array`. All elements in the array are going to be overridden with random numbers.

Returns the typed array that was passed in.

---
_Source: https://npm.io/package/react-native-get-random-values-fork · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
