main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 5 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
525 bytes
|
Rev | Line | |
---|
[79a0317] | 1 | "use strict";
|
---|
| 2 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
| 3 | exports.default = rng;
|
---|
| 4 | let getRandomValues;
|
---|
| 5 | const rnds8 = new Uint8Array(16);
|
---|
| 6 | function rng() {
|
---|
| 7 | if (!getRandomValues) {
|
---|
| 8 | if (typeof crypto === 'undefined' || !crypto.getRandomValues) {
|
---|
| 9 | throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
---|
| 10 | }
|
---|
| 11 | getRandomValues = crypto.getRandomValues.bind(crypto);
|
---|
| 12 | }
|
---|
| 13 | return getRandomValues(rnds8);
|
---|
| 14 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.