{"name":"react-native-securerandom","version":"1.0.1","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/robhogan"},"license":"MIT","peerDependencies":{"react-native":"*"},"repository":{"type":"git","url":"git+https://github.com/robhogan/react-native-securerandom.git"},"keywords":["react-native","SecRandomCopyBytes","PRNG","CSPRNG","SecureRandom","crypto","RandomNumberGenerator","Cryptography"],"homepage":"https://github.com/robhogan/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":"^29.0.3","flow-bin":"^0.187.1","jest":"^29.0.3","react-native":"^0.69.0"},"jest":{"transform":{"^.+\\.js$":"<rootDir>/jest.babel.js"}},"gitHead":"d60ec2258a50cab3be509fc89e26c0c1c720aa94","bugs":{"url":"https://github.com/robhogan/react-native-securerandom/issues"},"_id":"react-native-securerandom@1.0.1","_nodeVersion":"18.8.0","_npmVersion":"8.18.0","dist":{"integrity":"sha512-ibuDnd3xi17HyD5CkilOXGPFpS9Z1oifjyHFwUl8NMzcQcpruM0ZX8ytr3A4rCeAsaBHjz69r78Xgd6vUswv1Q==","shasum":"dc983cce980c80d1af62406e2ef2917ed0ada55f","tarball":"http://registry-npm.ywwl.com/react-native-securerandom/download/react-native-securerandom-1.0.1.tgz","fileCount":27,"unpackedSize":51400,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF3xyYxdI57N/6xBmAuIabLo6K8vJ94QfWylm8W1eCVhAiEAgCdMRiNJ2zDpEiAKsvMwo6EfU0n/L+5JIUSoxICGHuM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLFEJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo+NxAAgiXFzogNCjTyOJW+mXA6OZzLmBPzUzKH730J1IyVVKT3qca7\r\notZ87gRmDwzSrvi7XJ9aR1v/biN3cVGNpsaLwS9Om/Fs29/FVCN2oUrYrOoh\r\nv0AipIfnJhPBmlvhjpeiMBf+bR43grqZgDygEXge+JyQgeNuzmR1GKPwcwZ2\r\nDFSzIYz/Ux8TxFgW3XQHUKB/y2192lE9Eyv2WXcSYfeLCIZWPV44vcmfnBJL\r\ndH/dTQJ1yk4co8YJnz/IoB2Amb0fPctSpMYTlV6tlwzfvGXU9KXiFSR5uyE+\r\nd1LZmzAidjAgj7Z+JiINsbsPKXdMieUl0fCnD+7NS1vWr9AOMbyYuYR5es1a\r\nxIz2ODAo5/CAszBR5ZiYH1I33eNIzqv01Zqqql6BHTL4+dIhB2BaXXexGr0+\r\nNIXJrYUunVzBZm8vRjX2BR9xxMkGLXzM+jlV0lxkTDllXydFKJqIjRl+Kar7\r\n9jwO2qUR5iSuVEyjapiqos+GJaDr8W5DUDTDEfohDstg7XwheGySuSveydWB\r\nDYZZLo3gyeeGTueJp066z007MXmFHkkbQMVspSIoC5jr0vY9Ma+FRahXBA0v\r\nQ3KjTfcrJ1zevCRqnP8wM/ReZDhszFmwrATCXM3XrGQsl1qz2sQG16KW+JQ4\r\nDVply6uxLl7e0sMeS9BHg5y7ytF3hZGFFqw=\r\n=6MeP\r\n-----END PGP SIGNATURE-----\r\n","size":14878,"noattachment":false,"key":"/react-native-securerandom/-/react-native-securerandom-1.0.1.tgz"},"_npmUser":{"name":"rh389","email":"rob@rhogan.net"},"directories":{},"maintainers":[{"name":"rh389","email":"rob@rhogan.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-securerandom_1.0.1_1663848713657_0.6326817674061487"},"_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":1663848713796,"_cnpm_publish_time":1663848713796,"dist-tags":{"latest":"1.0.1"}}