@easyui/element-plus-pro
Version:
This is an extended ui components library for element-plus
2 lines (1 loc) • 835 B
JavaScript
;const u=[];for(let n=0;n<256;++n)u.push((n+256).toString(16).slice(1));function o(n,t=0){return(u[n[t+0]]+u[n[t+1]]+u[n[t+2]]+u[n[t+3]]+"-"+u[n[t+4]]+u[n[t+5]]+"-"+u[n[t+6]]+u[n[t+7]]+"-"+u[n[t+8]]+u[n[t+9]]+"-"+u[n[t+10]]+u[n[t+11]]+u[n[t+12]]+u[n[t+13]]+u[n[t+14]]+u[n[t+15]]).toLowerCase()}let e;const i=new Uint8Array(16);function y(){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 p=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),c={randomUUID:p};function m(n,t,r){if(c.randomUUID&&!t&&!n)return c.randomUUID();n=n||{};const d=n.random||(n.rng||y)();return d[6]=d[6]&15|64,d[8]=d[8]&63|128,o(d)}exports.v4=m;