{"name":"expo-random","version":"5.0.0-rc.0","keywords":["react-native","expo","random","crypto","random-bytes","secure","generator","bytes"],"author":{"name":"650 Industries, Inc."},"license":"MIT","_id":"expo-random@5.0.0-rc.0","homepage":"https://github.com/expo/expo/tree/master/packages/expo-random","bugs":{"url":"https://github.com/expo/expo/issues"},"dist":{"shasum":"273b45d858d0e0e4fdcaca97c5401f2c406a9478","tarball":"http://registry-npm.ywwl.com/expo-random/download/expo-random-5.0.0-rc.0.tgz","fileCount":24,"integrity":"sha512-bVAFAdXr4+wxERUm0DlKLEFwQCg1UJu5mHjx4OVoZpqPIjGBwrtAlP/jA9nbqozbM/cYGYHUKB5MCfFqLEriTg==","signatures":[{"sig":"MEQCICSHtN0bN0eQ1RVb+UiBZoriUK8REPUKILoGg9RT3SZTAiBzGm2/m8oX+rObElxPXtLpnTBIHUsr0GF4uc3jzZGkiQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc0X0UCRA9TVsSAnZWagAARuYP/jB8eFzGXV5GA31QsgCb\n3HxuQqHd5PsTk/gyeuhbGmO5n7s2JwW83yDUaHmqqzRTpy7Ykm/Za0IDf+at\n9M/ynK83NZ7U2qWM6ta7siMoXvADNLxFUJkwkMDLKt2IkvrRH0FOx9cXF2vC\nvPnDKMXPtc0brVDQD0k6pIQbXMd8K58R1pTuMZQxVagMs+FnWaCvGkdcWaV9\ncf8EEQIBBKVpX+cMN79FBkFrAFDY5KlvjuhCxkJjeRsBUMl/yDLwerkIAWm+\nvAaMoRSr1Xmo0yfn4ESFRo0ftmQONqdPC8aXpUqiIz7n7NRBzFdKQSnoUQcs\n5cgOcDaByH6QIFYk/g4jptdUM0O2tgpmMlh2V5M+rHZ3U8Jy0yB8jcvejFbw\nSuqD0p2JLFf9kT6cb7+RYLmwwhABaLKg6SI3wW9TNFvVaECDkyIHq2b0KLeG\nR9W4dNn8fXyoAxgbbwDcKUoyi4uUnWQwXsbRmAqYlkwUsWZ6iILyFJCtfoMX\ny8HqzpaDfnNviyiGea25HUS6AB5NuDoxS7TQ02oJRMR16LfdX9DomF/R0Ue9\nFrZnN1pEFBlGTW5wtUAtBo5WYFsI829InEhVYSB3YUe8CDhaeC2P7VMIkpQ4\n2TICMpRaHo2WaG4/W8sTNUHouPwOmZ5jTfXccSspUAp1hqvmxLsMZjr7B7US\nfOM1\r\n=nqAN\r\n-----END PGP SIGNATURE-----\r\n","size":5697,"noattachment":false,"key":"/expo-random/-/expo-random-5.0.0-rc.0.tgz"},"jest":{"preset":"expo-module-scripts"},"main":"build/Random.js","types":"build/Random.d.ts","gitHead":"211a7a3ce4007e7aa10ccf6efac4b5333ec31d0a","scripts":{"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":"https://github.com/expo/expo.git","type":"git"},"description":"Expo universal module for random bytes","directories":{},"sideEffects":false,"dependencies":{"base64-js":"^1.3.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"expo-module-scripts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/expo-random_5.0.0-rc.0_1557232915487_0.9636930989998269","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\n\nThis package is pre-installed in [managed](https://docs.expo.io/versions/latest/introduction/managed-vs-bare/) Expo projects as of SDK 33. You may skip the rest of the installation guide if this applies to you.\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```\nnpm install expo-random\n```\n\n### Configure for iOS\n\nRun `pod install` in the ios directory after installing the npm package.\n\n### Configure for Android\n\nNo additional set up necessary.\n\n# Docoumentation\n\n```js\n// in managed apps:\nimport { Random } from 'expo';\n\n// in bare apps:\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":1557232915678,"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":1557232915678,"dist-tags":{"canary":"0.0.1-canary-20240418-8d74597","latest":"14.0.1","sdk-50":"13.6.0","sdk-51":"14.0.1"}}