const a=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],c=["B","Ki","Mi","Gi","Ti","Pi","Ei","Zi","Yi"];function l(i,n=!1){const t=Number.parseInt(i,10)||0;return u(t,n)}function u(i,n=!1){const t=Math.floor(Math.log(i)/Math.log(1024))||0;return t<0?"0 B":`${(i/1024**t).toFixed(1)} ${n?c[t]:a[t]}`}function B(i,n,t=!1){return f(i,n,t).toString(10)}function f(i,n,t=!1){const o=Number.parseFloat(i),e=(t?c:a).findIndex(r=>r===n);return e===-1?0:o*1024**e}function d(i=20){let n="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";const t=n.split("");for(let o=t.length-1;o>0;o--){const s=Math.floor(Math.random()*(o+1)),e=t[o],r=t[s];e!==void 0&&r!==void 0&&(t[o]=r,t[s]=e)}return n=t.join(""),n.slice(0,i)}export{u as f,B as g,d as m,l as n};
