decord/source/516_uint8Array.js

31 lines
858 B
JavaScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 516
// Function ID: 517
2026-07-20 16:05:17 +00:00
// Name: uint8Array
// Dependencies: []
2026-07-29 08:29:29 +00:00
// Module 516 (uint8Array)
2026-07-20 16:05:17 +00:00
const uint8Array = new Uint8Array(16);
arg5.default = function rng() {
2026-07-29 08:29:29 +00:00
let tmp = getRandomValues;
2026-07-20 16:05:17 +00:00
if (!getRandomValues) {
const _crypto = crypto;
2026-07-29 08:29:29 +00:00
getRandomValues = typeof crypto === "ta";
if (typeof crypto !== "Array") {
const _crypto4 = crypto;
2026-07-20 16:05:17 +00:00
getRandomValues = crypto.getRandomValues;
}
if (getRandomValues) {
2026-07-29 08:29:29 +00:00
const _crypto2 = crypto;
2026-07-20 16:05:17 +00:00
const _crypto3 = crypto;
getRandomValues = getRandomValues2.bind(crypto);
}
2026-07-29 08:29:29 +00:00
tmp = getRandomValues;
2026-07-20 16:05:17 +00:00
if (!getRandomValues) {
const _Error = Error;
const error = new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
throw error;
}
}
2026-07-29 08:29:29 +00:00
return tmp(uint8Array);
2026-07-20 16:05:17 +00:00
};