Created
April 10, 2021 12:15
-
-
Save majirosstefan/3f9bbf37837ea1b699e47a4674c9b3e0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'react-native-get-random-values' | |
import {AppRegistry, Platform} from 'react-native'; | |
import {name as appName} from './app.json'; | |
import App from './src/setup/index.rootComponent.js'; | |
// new Array(10) does not work | |
// Supported Array types from docs - https://www.npmjs.com/package/react-native-get-random-values; | |
// 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 number | |
const array = new Uint8Array(10); | |
console.log(global.crypto.getRandomValues) | |
global.crypto.getRandomValues(array); | |
console.log(array) | |
AppRegistry.registerComponent(appName, () => App); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment