Package Exports
- @react-native-module/get-random-values
- @react-native-module/get-random-values/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@react-native-module/get-random-values) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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-valuesyarn add @react-native-module/get-random-valuesUsage
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 anInt8Array, aUint8Array, anInt16Array, aUint16Array, anInt32Array, or aUint32Array. All elements in the array are going to be overridden with random numbers.
Returns the typed array that was passed in.