-
-
Notifications
You must be signed in to change notification settings - Fork 903
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Thanks to LinusU/react-native-get-random-values#13 Expo finally has support for a sync CSPRNG. See also: https://dev.to/expo/expo-sdk-39-is-now-available-1lm8#new-synchronous-method-in-raw-exporandom-endraw- Fixes #375
- Loading branch information
Showing
2 changed files
with
8 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ For the creation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDs | |
- Node 8, 10, 12, 14 | ||
- Chrome, Safari, Firefox, Edge, IE 11 browsers | ||
- Webpack and rollup.js module bundlers | ||
- [React Native](#react-native) | ||
- [React Native / Expo](#react-native-expo) | ||
- **Secure** - Cryptographically-strong random values | ||
- **Small** - Zero-dependency, small footprint, plays nice with "tree shaking" packagers | ||
- **CLI** - Includes the [`uuid` command line](#command-line) utility | ||
|
@@ -405,7 +405,7 @@ Methods for the other algorithms ([`uuidv1()`](#uuidv1options-buffer-offset), [` | |
|
||
This error occurs in environments where the standard [`crypto.getRandomValues()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) API is not supported. This issue can be resolved by adding an appropriate polyfill: | ||
|
||
### React Native | ||
### React Native / Expo | ||
|
||
1. Install [`react-native-get-random-values`](https://github.com/LinusU/react-native-get-random-values#readme) | ||
1. Import it _before_ `uuid`. Since `uuid` might also appear as a transitive dependency of some other imports it's safest to just import `react-native-get-random-values` as the very first thing in your entry point: | ||
|
@@ -415,6 +415,8 @@ import 'react-native-get-random-values'; | |
import { v4 as uuidv4 } from 'uuid'; | ||
``` | ||
|
||
Note: If you are using Expo, you must be using at least `[email protected]` and `[email protected]`. | ||
|
||
### Web Workers / Service Workers (Edge <= 18) | ||
|
||
[In Edge <= 18, Web Crypto is not supported in Web Workers or Service Workers](https://caniuse.com/#feat=cryptography) and we are not aware of a polyfill (let us know if you find one, please). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ For the creation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDs | |
- Node 8, 10, 12, 14 | ||
- Chrome, Safari, Firefox, Edge, IE 11 browsers | ||
- Webpack and rollup.js module bundlers | ||
- [React Native](#react-native) | ||
- [React Native / Expo](#react-native-expo) | ||
- **Secure** - Cryptographically-strong random values | ||
- **Small** - Zero-dependency, small footprint, plays nice with "tree shaking" packagers | ||
- **CLI** - Includes the [`uuid` command line](#command-line) utility | ||
|
@@ -411,7 +411,7 @@ Methods for the other algorithms ([`uuidv1()`](#uuidv1options-buffer-offset), [` | |
|
||
This error occurs in environments where the standard [`crypto.getRandomValues()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) API is not supported. This issue can be resolved by adding an appropriate polyfill: | ||
|
||
### React Native | ||
### React Native / Expo | ||
|
||
1. Install [`react-native-get-random-values`](https://github.com/LinusU/react-native-get-random-values#readme) | ||
1. Import it _before_ `uuid`. Since `uuid` might also appear as a transitive dependency of some other imports it's safest to just import `react-native-get-random-values` as the very first thing in your entry point: | ||
|
@@ -421,6 +421,8 @@ import 'react-native-get-random-values'; | |
import { v4 as uuidv4 } from 'uuid'; | ||
``` | ||
|
||
Note: If you are using Expo, you must be using at least `[email protected]` and `[email protected]`. | ||
|
||
### Web Workers / Service Workers (Edge <= 18) | ||
|
||
[In Edge <= 18, Web Crypto is not supported in Web Workers or Service Workers](https://caniuse.com/#feat=cryptography) and we are not aware of a polyfill (let us know if you find one, please). | ||
|