@easyui/element-plus-pro
Version:
This is an extended ui components library for element-plus
28 lines (27 loc) • 1.04 kB
JavaScript
const d = [];
for (let n = 0; n < 256; ++n)
d.push((n + 256).toString(16).slice(1));
function c(n, t = 0) {
return (d[n[t + 0]] + d[n[t + 1]] + d[n[t + 2]] + d[n[t + 3]] + "-" + d[n[t + 4]] + d[n[t + 5]] + "-" + d[n[t + 6]] + d[n[t + 7]] + "-" + d[n[t + 8]] + d[n[t + 9]] + "-" + d[n[t + 10]] + d[n[t + 11]] + d[n[t + 12]] + d[n[t + 13]] + d[n[t + 14]] + d[n[t + 15]]).toLowerCase();
}
let e;
const i = new Uint8Array(16);
function p() {
if (!e) {
if (typeof crypto > "u" || !crypto.getRandomValues)
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
e = crypto.getRandomValues.bind(crypto);
}
return e(i);
}
const y = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), o = { randomUUID: y };
function r(n, t, m) {
if (o.randomUUID && !t && !n)
return o.randomUUID();
n = n || {};
const u = n.random || (n.rng || p)();
return u[6] = u[6] & 15 | 64, u[8] = u[8] & 63 | 128, c(u);
}
export {
r as v
};