/** * @name @jsweb/randkey * @version 4.1.5 * @desc Simple JS module to generate random id/key/hash in various formats, including UUID v4 * @author Alex Bruno * @create date 2016-06-26 03:21:18 * @modify date 2022-12-05 16:03:39 */ function m(t){let n=Math.random()*t.length,r=Math.floor(n);return t[r]}function e(t,n,r){return t>=n&&t<=r}function u(t=10,n=40){let r=Date.now()*Math.random(),g=e(t,2,36)?t:10,p=e(n,1,40)?n:40;return Math.round(r).toString(g).substring(0,p)}function i(t=11){return u(16,t)}function c(){return i(4)}function o(){return i(8)}function s(){return`${o()}${o()}`}function a(){return`${s()}${s()}`}function F(){return`${a()}${a()}`}function h(){let t=[8,9,"a","b"];return[o(),c(),`4${i(3)}`,`${m(t)}${i(3)}`,`${c()}${o()}`].join("-")}function w(){return[2,4,6,8,16].map(t=>u(t,5)).join("-")}function f(t=10){return Array(5).fill(t).map(n=>u(n,5)).join("-")}function y(){return f(16)}function D(){return f(36)}export{i as hex,y as huid,s as id16,a as id32,c as id4,F as id64,o as id8,w as puid,u as rand,f as ruid,h as uuid,D as wuid};