Skip to content

Commit f2c235f

Browse files
authored
fix!: expect crypto to be global everywhere (requires node@20+) (#935)
1 parent 529ef08 commit f2c235f

12 files changed

Lines changed: 1213 additions & 2119 deletions

File tree

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ npm install uuid
3434
```javascript
3535
import { v4 as uuidv4 } from "uuid";
3636

37-
uuidv4(); // ⇨ 'd02fd2bc-0baa-4a06-ae2f-fde2bbaff694'
37+
uuidv4(); // ⇨ 'ab16e731-6cee-424d-81a0-5929e9bdb0cc'
3838
```
3939

4040
For timestamp UUIDs, namespace UUIDs, and other options read on ...
@@ -179,7 +179,7 @@ Example:
179179
```javascript
180180
import { v1 as uuidv1 } from "uuid";
181181

182-
uuidv1(); // ⇨ '56eaf9f0-310a-11f1-8b06-cf0bf06de9bb'
182+
uuidv1(); // ⇨ '4d9d2960-31d0-11f1-aba8-29728d41eeed'
183183
```
184184

185185
Example using `options`:
@@ -234,7 +234,7 @@ Example:
234234
```javascript
235235
import { v4 as uuidv4 } from "uuid";
236236

237-
uuidv4(); // ⇨ 'c3d46383-7242-4b80-973b-eb3c66ad8d9e'
237+
uuidv4(); // ⇨ '7934256a-bc92-4b69-b240-f9e463881aea'
238238
```
239239

240240
Example using predefined `random` values:
@@ -310,7 +310,7 @@ This method takes the same arguments as uuid.v1().
310310
```javascript
311311
import { v6 as uuidv6 } from "uuid";
312312

313-
uuidv6(); // ⇨ '1f1310a5-6eb9-6630-bf43-2b49087aab53'
313+
uuidv6(); // ⇨ '1f131d04-d9dc-65a0-9516-5be66631ce97'
314314
```
315315

316316
Example using `options`:
@@ -357,7 +357,7 @@ Example:
357357
```javascript
358358
import { v7 as uuidv7 } from "uuid";
359359

360-
uuidv7(); // ⇨ '019d5e6b-6713-7339-951f-6e19a533527d'
360+
uuidv7(); // ⇨ '019d637c-c6fb-74e9-8b9d-2f1d459a4201'
361361
```
362362

363363
### ~~uuid.v8()~~
@@ -470,7 +470,7 @@ Prior to `uuid@11`, it was possible for `options` state to interfere with the in
470470

471471
## Known issues
472472

473-
<!-- This header is referenced as an anchor in src/rng-browser.ts -->
473+
<!-- This header is referenced as an anchor in src/rng.ts -->
474474

475475
### "getRandomValues() not supported"
476476

README_js.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,7 @@ Prior to `uuid@11`, it was possible for `options` state to interfere with the in
467467

468468
## Known issues
469469

470-
<!-- This header is referenced as an anchor in src/rng-browser.ts -->
471-
470+
<!-- This header is referenced as an anchor in src/rng.ts -->
472471
### "getRandomValues() not supported"
473472

474473
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:

examples/utils/testpage.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export default function test(callback) {
3333
function done() {
3434
const div = document.createElement('h2');
3535
div.id = 'done';
36+
div.innerHTML = 'Done';
3637
document.body.appendChild(div);
3738
}
3839

0 commit comments

Comments
 (0)