{"name":"react-native-securerandom","version":"1.0.0","description":"Generate cryptographically-secure random bytes in react native","main":"index.js","scripts":{"test":"flow && jest"},"types":"index.d.ts","author":{"name":"Rob Hogan","email":"npm@rhogan.net","url":"https://github.com/rh389"},"license":"MIT","peerDependencies":{"react-native":"*"},"repository":{"type":"git","url":"git+https://github.com/rh389/react-native-securerandom.git"},"keywords":["react-native","SecRandomCopyBytes","PRNG","CSPRNG","SecureRandom","crypto","RandomNumberGenerator","Cryptography"],"homepage":"https://github.com/rh389/react-native-securerandom#readme","dependencies":{"base64-js":"*"},"devDependencies":{"@babel/core":"^7.1.2","@babel/plugin-transform-runtime":"^7.4.4","@babel/preset-env":"^7.1.0","babel-jest":"^24.8.0","flow-bin":"^0.78.0","jest":"^24.8.0","react-native":"^0.57.2"},"jest":{"transform":{"^.+\\.js$":"<rootDir>/jest.babel.js"}},"gitHead":"904321397834dac3a299e7971fa1d50d4cbfa5c3","bugs":{"url":"https://github.com/rh389/react-native-securerandom/issues"},"_id":"react-native-securerandom@1.0.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-lnhcsWloFzMN/HffyDBlh4VlqdhDH8uxEzUIH3aJPgC1PxV6OKZkvAk409EwsAhcmG/z3yZuVKegKpUr5IM9ug==","shasum":"1cff2f727c90c9ec3318b42dbf825a628b53b49b","tarball":"http://registry-npm.ywwl.com/react-native-securerandom/download/react-native-securerandom-1.0.0.tgz","fileCount":29,"unpackedSize":55795,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeyUIGCRA9TVsSAnZWagAA3+8P/1djT0ouXmOw5451vHUf\nNQnF7iRAgx7qB2His4fcP8mXjaj+3HO2Yv3XDHtgSGDa+hfCJaPdbvVmA2Cc\n3C/VvFDau0jsjit8r+o7ihgRdkxo4LPv5EFhwMiVwLYhdg+duLKNPffShQ+5\nxn/5Si/Qs/AS05XVOUn0rhPNGl/ev5AEJ7niIOqMTLxpgKZw7l8DwyG2MlHk\nISjbOUmC8xVFmKtM+O+fDWYETctVysltx3MP1Xgia0P0t4KXsaXqL3TgnewE\nv0X+Ps9hpFYMRCYOnVSt2sZVJO6Ri9fwYP8cvnXK2lVsUmUHs18hwYFc8uZP\nGoQiZNKL9nFKSm122zUukqs6AIlsmCv+yyTd0FWVgsvTtUjs4XfE7mlqRz3H\n1Llxil69Tr4m0Lt3yVkLAJbc9gvcIPawQefC4KHaJNDJ2sj86/TIZh8K8dXU\nTh2R/hP/Kgt0PZiIA0N9X97Df5rBZvmyVijClL8nyON+jToIGg+HkepBPD0T\nXnkVAltb4VauzceOvb0RUuTPGDPeEtpzwoMO+5daUY3Vjv4VyfguV7TLGKpL\ntXF7V+rpxyxYRkBAB0r3SIgo8pFIYs0KfD432mffH6qlcEMJ7y709Q4iGDSQ\nU+sbX9XmwUtMSX/v/TnMhtk3kQWenKCyqLqHwcfsEF2k1IJdyxFtnGXSw1q4\nMGLA\r\n=+a4H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH9zt/2PiLF2uVQD6YWf6A5o9gvzRE0U4qv+ut3vubu4AiEA5pGnLgekN6kvZEm8lOhzzTvHgDlp9sirncBrm2pr/rc="}],"size":16176,"noattachment":false,"key":"/react-native-securerandom/-/react-native-securerandom-1.0.0.tgz"},"maintainers":[{"name":"rh389","email":"roberthogan@blueyonder.co.uk"}],"_npmUser":{"name":"rh389","email":"roberthogan@blueyonder.co.uk"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-securerandom_1.0.0_1590247942020_0.5499582524304114"},"_hasShrinkwrap":false,"readme":"# react-native-securerandom\n[![npm version](https://badge.fury.io/js/react-native-securerandom.svg)](https://badge.fury.io/js/react-native-securerandom)\n\nA library to generate cryptographically-secure random bytes. Uses `SecRandomCopyBytes` on iOS, `SecureRandom` on Android and `System.Security.Cryptography.RandomNumberGenerator` on Windows.\n\n## Usage\nThe library exports a single function:\n### generateSecureRandom(length: number) => Promise\\<Uint8Array\\>\nTakes a length, the number of bytes to generate, and returns a `Promise` that resolves with a `Uint8Array`.\n\n```javascript\nimport { generateSecureRandom } from 'react-native-securerandom';\n\ngenerateSecureRandom(12).then(randomBytes => console.log(randomBytes));\n```\n\n## Installation\n\n`$ yarn add react-native-securerandom`\n\n### Automatic linking with react-native link\n\n`$ react-native link react-native-securerandom`\n\n### Manual linking\n\n#### iOS\n\n##### With Cocoapods\n1. Add `pod 'RNSecureRandom', :path => '../node_modules/react-native-securerandom'` to your `Podfile` (changing your `node_modules` path as appropriate)\n2. Run `pod install` from the same directory as your `Podfile`\n\n##### Without Cocoapods\n1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`\n2. Go to `node_modules` ➜ `react-native-securerandom` and add `RNSecureRandom.xcodeproj`\n3. In XCode, in the project navigator, select your project. Add `libRNSecureRandom.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`\n\n#### Android\n\n1. Open up `android/app/src/main/java/[...]/MainActivity.java`\n  - Add `import net.rhogan.rnsecurerandom.RNSecureRandomPackage;` to the imports at the top of the file\n  - Add `new RNSecureRandomPackage()` to the list returned by the `getPackages()` method\n2. Append the following lines to `android/settings.gradle`:\n  \t```\n  \tinclude ':react-native-securerandom'\n  \tproject(':react-native-securerandom').projectDir = new File(rootProject.projectDir, \t'../node_modules/react-native-securerandom/android')\n  \t```\n3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:\n  \t```\n      compile project(':react-native-securerandom')\n  \t```\n\n#### Windows\n\nSee [react-native-windows](https://github.com/Microsoft/react-native-windows)\n\n1. In Visual Studio add `node_modules/react-native-securerandom/windows/RNSecureRandom.sln` folder to your solution, and reference from your app.\n2. Open up your app's `MainPage.cs`\n  - Add `using Net.Rhogan.RNSecureRandom.RNSecureRandom;` to the usings at the top of the file\n  - Add `new RNSecureRandomPackage()` to the `List<IReactPackage>` returned by the `Packages` method\n","publish_time":1590247942133,"_cnpm_publish_time":1590247942133,"dist-tags":{"latest":"1.0.1"}}