@react-native-module/get-random-values
TypeScript icon, indicating that this package has built-in type declarations

1.8.4 • Public • Published

react-native-module/get-random-values

This module export a function getRandomValues only with same Web API crypto.getRandomValues

Why use this module not react-native-get-random-values

react-native-get-random-values is pollifill package, but, this module add anything on global scope

Installation

A typical workflow:

npm i --save @react-native-module/get-random-values
yarn add @react-native-module/get-random-values

Usage

import { getRandomValues } from "@react-native-module/get-random-values";

const randomValues = getRandomValues(new Uint8Array(4));

getRandomValues(typedArray)

  • 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.

Package Sidebar

Install

npm i @react-native-module/get-random-values

Weekly Downloads

3

Version

1.8.4

License

MIT

Unpacked Size

36 kB

Total Files

33

Last publish

Collaborators

  • sacru2red