2017-10-11 17:27:00 +01:00
2017-10-11 17:27:00 +01:00
2017-10-11 17:27:00 +01:00
2017-10-11 17:27:00 +01:00
2017-10-11 19:00:59 +01:00
2017-10-11 17:27:00 +01:00

react-native-random-bytes

Getting started

$ npm install react-native-random-bytes --save

Mostly automatic installation

$ react-native link react-native-random-bytes

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-random-bytes and add RNRandomBytes.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNRandomBytes.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.reactlibrary.RNRandomBytesPackage; to the imports at the top of the file
  • Add new RNRandomBytesPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-random-bytes'
    project(':react-native-random-bytes').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-random-bytes/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-random-bytes')
    

Windows

Read it! :D

  1. In Visual Studio add the RNRandomBytes.sln in node_modules/react-native-random-bytes/windows/RNRandomBytes.sln folder to their solution, reference from their app.
  2. Open up your MainPage.cs app
  • Add using Random.Bytes.RNRandomBytes; to the usings at the top of the file
  • Add new RNRandomBytesPackage() to the List<IReactPackage> returned by the Packages method

Usage

import RNRandomBytes from 'react-native-random-bytes';

// TODO: What to do with the module?
RNRandomBytes;
S
Description
A crypto-secure random bytes generator for react native
Readme MIT
336 KiB
Languages
C# 31.3%
C++ 28.6%
Java 16%
Objective-C 9%
JavaScript 6%
Other 9.1%