From 8ca3eba5efb68d09f2cebfb4af13054f67d9bb65 Mon Sep 17 00:00:00 2001 From: Mark Vayngrib Date: Thu, 19 Nov 2015 20:09:49 +0000 Subject: [PATCH] add README --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..1aaef62 --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# react-native-randombytes + +## Usage + +Note: only the asynchronous API is supported, due to the limitations of having to go over the RCTBridge, and there being no secure RNG in JavaScriptCore (Math.random is a bit of a joke in the industry) + +```js +var randomBytes = require('react-native-randombytes') +randomBytes(4, (err, bytes) => { + console.log(bytes.toString('hex')) +}) +``` + +## Installation + +### `iOS` + +* Drag RNRandomBytes.xcodeproj from node_modules/react-native-randombytes into your XCode project. + +* Click on the project in XCode, go to Build Phases, then Link Binary With Libraries and add `libRNRandomBytes.a` + +Confused? See an example with screenshots [here](http://facebook.github.io/react-native/docs/linking-libraries-ios.html#content)