@nsshunt/stsrunnerframework 1.0.31 → 1.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1896,11 +1896,15 @@ function rng() {
|
|
|
1896
1896
|
const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
1897
1897
|
const native = { randomUUID };
|
|
1898
1898
|
function v4(options, buf, offset) {
|
|
1899
|
+
var _a;
|
|
1899
1900
|
if (native.randomUUID && !buf && !options) {
|
|
1900
1901
|
return native.randomUUID();
|
|
1901
1902
|
}
|
|
1902
1903
|
options = options || {};
|
|
1903
|
-
const rnds = options.random
|
|
1904
|
+
const rnds = options.random ?? ((_a = options.rng) == null ? void 0 : _a.call(options)) ?? rng();
|
|
1905
|
+
if (rnds.length < 16) {
|
|
1906
|
+
throw new Error("Random bytes length must be >= 16");
|
|
1907
|
+
}
|
|
1904
1908
|
rnds[6] = rnds[6] & 15 | 64;
|
|
1905
1909
|
rnds[8] = rnds[8] & 63 | 128;
|
|
1906
1910
|
return unsafeStringify(rnds);
|