rsnext/packages/next/compiled/nanoid/index.cjs

1 line
1.2 KiB
JavaScript
Raw Normal View History

(()=>{var e={113:e=>{"use strict";e.exports=require("crypto")},240:(e,r,t)=>{let l=t(113);let{urlAlphabet:a}=t(294);const n=32;let _,u;let random=e=>{if(!_||_.length<e){_=Buffer.allocUnsafe(e*n);l.randomFillSync(_);u=0}else if(u+e>_.length){l.randomFillSync(_);u=0}let r=_.subarray(u,u+e);u+=e;return r};let customRandom=(e,r,t)=>{let l=(2<<31-Math.clz32(e.length-1|1))-1;let a=Math.ceil(1.6*l*r/e.length);return()=>{let n="";while(true){let _=t(a);let u=a;while(u--){n+=e[_[u]&l]||"";if(n.length===r)return n}}}};let customAlphabet=(e,r)=>customRandom(e,r,random);let nanoid=(e=21)=>{let r=random(e);let t="";while(e--){t+=a[r[e]&63]}return t};e.exports={nanoid:nanoid,customAlphabet:customAlphabet,customRandom:customRandom,urlAlphabet:a,random:random}},294:e=>{let r="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW";e.exports={urlAlphabet:r}}};var r={};function __nccwpck_require__(t){var l=r[t];if(l!==undefined){return l.exports}var a=r[t]={exports:{}};var n=true;try{e[t](a,a.exports,__nccwpck_require__);n=false}finally{if(n)delete r[t]}return a.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var t=__nccwpck_require__(240);module.exports=t})();