{"name":"expo-random","version":"8.2.0","keywords":["react-native","expo","random","crypto","random-bytes","secure","generator","bytes"],"author":{"name":"650 Industries, Inc."},"license":"MIT","_id":"expo-random@8.2.0","homepage":"https://github.com/expo/expo/tree/master/packages/expo-random","bugs":{"url":"https://github.com/expo/expo/issues"},"dist":{"shasum":"0f6adc418c2f85f4061030f2dfe9a9fa09613e82","tarball":"http://registry-npm.ywwl.com/expo-random/download/expo-random-8.2.0.tgz","fileCount":26,"integrity":"sha512-Ad4P7nGYq5mNOOiPBrsLw0n+pv19b7hG0B4kVppsN5Tki4Git/BG/tD5T8z+bKLP/aRuietaZnwz3RGu81g18w==","signatures":[{"sig":"MEUCIFebK9+/jNjJIR/V7pWEddHEd3zaCeLoNEiLJ1qELEgjAiEAh1aa03q+8muUFoaPsl7XB+NPikqK6n8n+jYYObF6nRE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15066,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezo41CRA9TVsSAnZWagAAcSgP/05xWZildjv9jnGvFZib\nTQowj94hXPndU5MhI4DkHj9ucEnbyygpj0QFG19rPROYD5f2mUf9R5jIgRas\nIu/sr3gliYOwcdw/nMHapSz3GW1oDoCwo9lhxWqpyhSPz1zJO015lz+NAH6t\nJNzqBy/OiV2C/hWLRikC8+ImuVL1YCAcZUy8iGQDLJYNZx3/WMb4odBJXEwj\nbKUl5dH2DZdNOvKzIpWNtuI6tO/nqdgqiAcDEPjGThCTFnXy85w31j9z9JOS\n5rihoHCwuBtAtz8F2ONQZk7Hkv3QUkpfEYHce6nmOtGfMxrkdVbGKC5tF3uP\nV/gwa6JbAr3aMZsK6zW2fofzHEos+uVXcOxUdwpOOYBsacjnLaDs3aL61XMO\nnHib9cnNF4oxyLmJUEbbGTa6Iy0wTr1RYU8b81JX7EWEdQtDStSOjiTKo0Vd\nh/DlRFCaq5MFj/TDE1klzFEg0Udyl1unKSIVj/XUn8INV3Q6tEKrhBzvnIqi\ntaEjnjK5+QEgROAC9hwB3vI4SITAEpGzV3ff47xRZAm9i/DeawfbJWh+JkPX\np5vRArkKVwWG0dgSZHL8ZxrnfrF5PBJ6vv+1w+k7MbAWpOcbXF+Kd7y4Fps8\nOYiuRQHaty7tYxVph5X2Zcs8CR0hqMXvIXMFzgrV1de06w21bUo7FuPDUkiV\nTgQ6\r\n=p19g\r\n-----END PGP SIGNATURE-----\r\n","size":5691,"noattachment":false,"key":"/expo-random/-/expo-random-8.2.0.tgz"},"jest":{"preset":"expo-module-scripts"},"main":"build/Random.js","types":"build/Random.d.ts","gitHead":"dfc7fdb9aee4ef6fa10a9693e3d0935a2d500ae2","scripts":{"lint":"expo-module lint","test":"expo-module test","build":"expo-module build","clean":"expo-module clean","prepare":"expo-module prepare","expo-module":"expo-module","prepublishOnly":"expo-module prepublishOnly"},"_npmUser":{"name":"tsapeta","email":"sapeta.tomasz@gmail.com"},"repository":{"url":"git+https://github.com/expo/expo.git","type":"git","directory":"packages/expo-random"},"_npmVersion":"6.14.4","description":"Expo universal module for random bytes","directories":{},"sideEffects":false,"_nodeVersion":"14.3.0","dependencies":{"base64-js":"^1.3.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"expo-module-scripts":"~1.2.0"},"_npmOperationalInternal":{"tmp":"tmp/expo-random_8.2.0_1590595124944_0.02229285139492898","host":"s3://npm-registry-packages"},"unimodulePeerDependencies":{"@unimodules/core":"*"},"readme":"# expo-random\n\nProvides a native interface for creating strong random bytes. With `Random` you can create values equivalent to `Node.js` core `crypto.randomBytes` API.\n\n# Installation in managed Expo projects\n\nFor managed [managed](https://docs.expo.io/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.io/versions/latest/sdk/random/).\n\n# Installation in bare React Native projects\n\nFor bare React Native projects, you must ensure that you have [installed and configured the `react-native-unimodules` package](https://github.com/unimodules/react-native-unimodules) before continuing.\n\n### Add the package to your npm dependencies\n\n```\nexpo install expo-random\n```\n\n### Configure for iOS\n\nRun `npx pod-install` after installing the npm package.\n\n### Configure for Android\n\nNo additional set up necessary.\n\n# Documentation\n\n```js\nimport * as Random from 'expo-random';\n```\n\n## Methods\n\n### `getRandomBytesAsync`\n\n```js\ngetRandomBytesAsync(byteCount: number): Promise<Uint8Array>\n```\n\nGenerates completely random bytes using native implementations. The `byteCount` property is a `number` indicating the number of bytes to generate in the form of a `Uint8Array`.\n\n**Parameters**\n\n| Name      | Type     | Description                                                                     |\n| --------- | -------- | ------------------------------------------------------------------------------- |\n| byteCount | `number` | A number within the range: **0...1024**. Anything else will throw a `TypeError` |\n\n**Returns**\n\n| Name        | Type                  | Description                                                      |\n| ----------- | --------------------- | ---------------------------------------------------------------- |\n| randomBytes | `Promise<Uint8Array>` | An array of random bytes with the same length as the `byteCount` |\n\n**Example**\n\n```js\nconst randomBytes = await Random.getRandomBytesAsync(3);\n```\n\n# Usage\n\n```javascript\nimport React from 'react';\nimport { View } from 'react-native';\nimport * as Random from 'expo-random';\n\nexport default class DemoView extends React.Component {\n  async componentDidMount() {\n    const randomBytes = await Random.getRandomBytesAsync(16);\n\n    /* Some crypto operation... */\n  }\n  render() {\n    return <View />;\n  }\n}\n```\n","publish_time":1590595125053,"maintainers":[{"email":"radoslaw.krzemien@swmansion.com","name":"radoslawkrzemien"},{"email":"piotrek.szeremeta@swmansion.com","name":"pkham"},{"email":"szymon.dziedzic@swmansion.com","name":"szdziedzic"},{"email":"npm@tsapeta.com","name":"tsapeta"},{"email":"ide+npm@jameside.com","name":"ide"},{"email":"kosmatylukasz@gmail.com","name":"lukmccall"},{"email":"beto@expo.io","name":"betoatexpo"},{"email":"phil@kitten.sh","name":"philpl"},{"email":"brent+expobotnpm@expo.io","name":"expo-bot"},{"email":"hughesno1@gmail.com","name":"alanhughes"},{"email":"hellokadi@gmail.com","name":"kadikraman"},{"email":"mikucki@gmail.com","name":"aleqsio"},{"email":"mwlawlor@gmail.com","name":"marklawlor"},{"email":"donadeldev@gmail.com","name":"gabrieldonadel"},{"email":"gosimek@gmail.com","name":"simek"},{"email":"keith@expo.io","name":"keith-kurak"},{"email":"chris@christopherwalter.com","name":"christopherwalter"},{"email":"datwheat@gmail.com","name":"fiber-god"},{"email":"brentvatne@gmail.com","name":"brentvatne"},{"email":"baconbrix@gmail.com","name":"evanbacon"},{"email":"quinlanjung@gmail.com","name":"quinlanj"},{"email":"support@expo.io","name":"expoadmin"},{"email":"exponent.team@gmail.com","name":"exponent"},{"email":"wschurman@gmail.com","name":"wschurman"},{"email":"me@bycedric.com","name":"bycedric"},{"email":"sampjon@gmail.com","name":"jonsamp"},{"email":"mhampton@hey.com","name":"princefleaswallow"},{"email":"ckchien@gmail.com","name":"kudochien"}],"deprecated":"This package is now deprecated in favor of expo-crypto, which provides the same functionality. To migrate, replace all imports from expo-random with imports from expo-crypto.","_cnpm_publish_time":1590595125053,"dist-tags":{"canary":"0.0.1-canary-20240418-8d74597","latest":"14.0.1","sdk-50":"13.6.0","sdk-51":"14.0.1"}}