PageSourceSearch

https://anyserv.eu/_astro/UuidGeneratorApp.3kFnDG16.js

js anyserv.eu collected 2026-09-24 14:21:43 UTC 13,027 bytes, 2 lines download raw bytes

1import{j as t}from"./jsx-runtime.u17CrQMm.js";import{r as d}from"./index.uFOh2Gdi.js";import{I as T}from"./InvoiceSelect.hvrwXG0W.js";import{i as A}from"./locale.BskNvxf4.js";const U=1,j=100,E=(Date.UTC(1970,0,1)-Date.UTC(1582,9,15))*1e4;function p(n){const e=new Uint8Array(n);return crypto.getRandomValues(e),e}function y(n){const e=Array.from(n,u=>u.toString(16).padStart(2,"0")).join("");return`${e.slice(0,8)}-${e.slice(8,12)}-${e.slice(12,16)}-${e.slice(16,20)}-${e.slice(20,32)}`}function R(n){n[8]=n[8]&63|128}function M(n){switch(n){case"v4":return w();case"v1":return B();case"v7":return F();default:return w()}}function w(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const n=p(16);return n[6]=n[6]&15|64,R(n),y(n)}function B(){const n=BigInt(Date.now())*10000n+BigInt(E),e=Number(n&0xffffffffn),u=Number(n>>32n&0xffffn),o=4096|Number(n>>48n&0x0fffn)&4095,i=p(2),l=p(6);l[0]=(l[0]|1)&255;const s=new Uint8Array(16);return s[0]=e>>>24&255,s[1]=e>>>16&255,s[2]=e>>>8&255,s[3]=e&255,s[4]=u>>>8&255,s[5]=u&255,s[6]=o>>>8&255,s[7]=o&255,s[8]=i[0]&63|128,s[9]=i[1],s.set(l,10),y(s)}function F(){const n=BigInt(Date.now())&0xffffffffffffn,e=p(2),u=p(8),o=28672|(e[0]<<8|e[1])&4095,i=new Uint8Array(16);return i[0]=Number(n>>40n&0xffn),i[1]=Number(n>>32n&0xffn),i[2]=Number(n>>24n&0xffn),i[3]=Number(n>>16n&0xffn),i[4]=Number(n>>8n&0xffn),i[5]=Number(n&0xffn),i[6]=o>>>8&255,i[7]=o&255,i[8]=u[0]&63|128,i[9]=u[1],i[10]=u[2],i[11]=u[3],i[12]=u[4],i[13]=u[5],i[14]=u[6],i[15]=u[7],y(i)}function O(n,e){let u=n.toLowerCase();return e.includes("no-hyphens")&&(u=u.replace(/-/g,"")),e.includes("uppercase")?u=u.toUpperCase():u=u.toLowerCase(),e.includes("braces")&&(u=`{${u}}`),u}function h(n){return Number.isFinite(n)?Math.max(U,Math.min(j,Math.floor(n))):U}function V(n,e){const u=[];return n==="uppercase"&&u.push("uppercase"),n==="no-hyphens"&&u.push("no-hyphens"),e&&u.push("braces"),u}function $(n,e,u){const r=h(e);return Array.from({length:r},()=>O(M(n),u))}function H(n,e){const u=new Blob([n],{type:"text/plain;charset=utf-8"}),r=URL.createObjectURL(u),o=document.createElement("a");o.href=r,o.download=`uuids-${e}-${Date.now()}.txt`,o.click(),URL.revokeObjectURL(r)}const I={"uuidGen.versionLabel":"UUID version","uuidGen.v4":"v4","uuidGen.v1":"v1","uuidGen.v7":"v7","uuidGen.v4Desc":"Random UUID – the most common choice for general use.","uuidGen.v1Desc":"Time-based UUID – includes a timestamp component.","uuidGen.v7Desc":"New standard – monotonically sortable, ideal for databases.","uuidGen.formatLabel":"Format","uuidGen.formatLowercase":"lowercase","uuidGen.formatUppercase":"UPPERCASE","uuidGen.formatNoHyphens":"no hyphens","uuidGen.countLabel":"Number of UUIDs","uuidGen.braces":"Wrap in braces","uuidGen.generate":"Generate","uuidGen.copy":"Copy","uuidGen.copied":"Copied!","uuidGen.copyAll":"Copy all","uuidGen.downloadTxt":"Download .txt","uuidGen.resultLabel":"Generated UUID","uuidGen.resultsLabel":"Generated UUIDs","uuidGen.noResults":"Click Generate to create UUIDs.","uuidGen.tooltip.version":"v4: random (default). v7: time-ordered for DB indexes. v1: embeds a timestamp.","uuidGen.tooltip.format":"Lowercase is common in APIs. UPPERCASE or no hyphens if your system requires it.","uuidGen.tooltip.count":"Generate 1–100 UUIDs at once. Larger batches copy or download as plain text.","uuidGen.tooltip.braces":"Wraps each value in {…} for .NET Guid strings. Works with any version."},P={"uuidGen.versionLabel":"Wersja UUID","uuidGen.v4":"v4","uuidGen.v1":"v1","uuidGen.v7":"v7","uuidGen.v4Desc":"Losowy UUID – najczęściej używany.","uuidGen.v1Desc":"Oparty na czasie – zawiera znacznik czasowy.","uuidGen.v7Desc":"Nowy standard – monotonicznie rosnący, idealny do baz danych.","uuidGen.formatLabel":"Format","uuidGen.formatLowercase":"małe litery","uuidGen.formatUppercase":"wielkie litery","uuidGen.formatNoHyphens":"bez myślników","uuidGen.countLabel":"Liczba UUID","uuidGen.braces":"Otocz klamrami","uuidGen.generate":"Generuj","uuidGen.copy":"Kopiuj","uuidGen.copied":"Skopiowano!","uuidGen.copyAll":"Kopiuj wszystkie","uuidGen.downloadTxt":"Pobierz .txt","uuidGen.resultLabel":"Wygenerowany UUID","uuidGen.resultsLabel":"Wygenerowane UUID","uuidGen.noResults":"Kliknij Generuj, aby utworzyć UUID.","uuidGen.tooltip.version":"v4: losowy (domyślnie). v7: uporządkowany czasowo dla indeksów DB. v1: ze znacznikiem czasu.","uuidGen.tooltip.format":"Małe litery są typowe w API. Wielkie litery lub brak myślników, gdy tego wymaga system.","uuidGen.tooltip.count":"Generuj 1–100 UUID naraz. Większe partie skopiuj lub pobierz jako plain text.","uuidGen.tooltip.braces":"Otocz każdą wartość klamrami {…} dla stringów .NET Guid. Działa z każdą wersją."},_={"uuidGen.versionLabel":"UUID-Version","uuidGen.v4":"v4","uuidGen.v1":"v1","uuidGen.v7":"v7","uuidGen.v4Desc":"Zufällige UUID – am häufigsten verwendet.","uuidGen.v1Desc":"Zeitbasiert – enthält einen Zeitstempel.","uuidGen.v7Desc":"Neuer Standard – monoton sortierbar, ideal für Datenbanken.","uuidGen.formatLabel":"Format","uuidGen.formatLowercase":"Kleinbuchstaben","uuidGen.formatUppercase":"GROSSBUCHSTABEN","uuidGen.formatNoHyphens":"ohne Bindestriche","uuidGen.countLabel":"Anzahl UUIDs","uuidGen.braces":"In Klammern","uuidGen.generate":"Generieren","uuidGen.copy":"Kopieren","uuidGen.copied":"Kopiert!","uuidGen.copyAll":"Alle kopieren","uuidGen.downloadTxt":".txt herunterladen","uuidGen.resultLabel":"Generierte UUID","uuidGen.resultsLabel":"Generierte UUIDs","uuidGen.noResults":"Klicken Sie auf Generieren.","uuidGen.tooltip.version":"v4: zufällig (Standard). v7: zeitlich sortierbar für DB-Indizes. v1: mit Zeitstempel.","uuidGen.tooltip.format":"Kleinbuchstaben sind in APIs üblich. Großbuchstaben oder ohne Bindestriche, wenn nötig.","uuidGen.tooltip.count":"1–100 UUIDs auf einmal. Größere Mengen kopieren oder als Text herunterladen.","uuidGen.tooltip.braces":"Jeden Wert in {…} für .NET-Guid-Strings. Funktioniert mit jeder Version."},K={"uuidGen.versionLabel":"Version UUID","uuidGen.v4":"v4","uuidGen.v1":"v1","uuidGen.v7":"v7","uuidGen.v4Desc":"UUID aléatoire – le plus courant.","uuidGen.v1Desc":"Basé sur l'heure – contient un horodatage.","uuidGen.v7Desc":"Nouveau standard – tri monotone, idéal pour les bases de données.","uuidGen.formatLabel":"Format","uuidGen.formatLowercase":"minuscules","uuidGen.formatUppercase":"MAJUSCULES","uuidGen.formatNoHyphens":"sans tirets","uuidGen.countLabel":"Nombre d'UUID","uuidGen.braces":"Entre accolades","uuidGen.generate":"Générer","uuidGen.copy":"Copier","uuidGen.copied":"Copié !","uuidGen.copyAll":"Tout copier","uuidGen.downloadTxt":"Télécharger .txt","uuidGen.resultLabel":"UUID généré","uuidGen.resultsLabel":"UUID générés","uuidGen.noResults":"Cliquez sur Générer pour créer des UUID.","uuidGen.tooltip.version":"v4 : aléatoire (par défaut). v7 : ordonné dans le temps pour les index DB. v1 : avec horodatage.","uuidGen.tooltip.format":"Minuscules courantes en API. Maju
1scules ou sans tirets si votre système l'exige.","uuidGen.tooltip.count":"Générez 1–100 UUID à la fois. Copiez ou téléchargez les lots en texte brut.","uuidGen.tooltip.braces":"Entoure chaque valeur de {…} pour les Guid .NET. Compatible avec toute version."},W={"uuidGen.versionLabel":"Versión UUID","uuidGen.v4":"v4","uuidGen.v1":"v1","uuidGen.v7":"v7","uuidGen.v4Desc":"UUID aleatorio – el más usado.","uuidGen.v1Desc":"Basado en tiempo – incluye marca temporal.","uuidGen.v7Desc":"Nuevo estándar – orden monótono, ideal para bases de datos.","uuidGen.formatLabel":"Formato","uuidGen.formatLowercase":"minúsculas","uuidGen.formatUppercase":"MAYÚSCULAS","uuidGen.formatNoHyphens":"sin guiones","uuidGen.countLabel":"Cantidad de UUID","uuidGen.braces":"Entre llaves","uuidGen.generate":"Generar","uuidGen.copy":"Copiar","uuidGen.copied":"¡Copiado!","uuidGen.copyAll":"Copiar todos","uuidGen.downloadTxt":"Descargar .txt","uuidGen.resultLabel":"UUID generado","uuidGen.resultsLabel":"UUID generados","uuidGen.noResults":"Haz clic en Generar para crear UUID.","uuidGen.tooltip.version":"v4: aleatorio (predeterminado). v7: orden temporal para índices DB. v1: con marca temporal.","uuidGen.tooltip.format":"Minúsculas habituales en APIs. Mayúsculas o sin guiones si tu sistema lo exige.","uuidGen.tooltip.count":"Genera 1–100 UUID a la vez. Copia o descarga lotes como texto plano.","uuidGen.tooltip.braces":"Envuelve cada valor en {…} para cadenas Guid de .NET. Funciona con cualquier versión."},q={en:I,pl:P,de:_,fr:K,es:W};function Z(n){const e=(n||"en").split("-")[0];return A(e)?q[e]:I}function J(n){const[e,u]=d.useState(n),r=d.useMemo(()=>Z(e),[e]),o=d.useCallback(i=>r[i]??i,[r]);return d.useEffect(()=>{u(n)},[n]),{tr:o,uiLocale:e}}function v({htmlFor:n,label:e,tooltip:u,as:r="label",className:o=""}){const i=r,l=r==="legend"?`uuid-legend-label${o?` ${o}`:""}`:`field-label${o?` ${o}`:""}`;return t.jsxs(i,{className:l,...n?{htmlFor:n}:{},children:[t.jsx("span",{children:e}),t.jsxs("span",{className:"tooltip-wrapper",tabIndex:0,children:[t.jsx("span",{className:"tooltip-icon","aria-hidden":"true",children:"i"}),t.jsx("span",{className:"tooltip-text",style:{display:"none"},children:u})]})]})}const Y=["v4","v1","v7"],X={v4:"uuidGen.v4Desc",v1:"uuidGen.v1Desc",v7:"uuidGen.v7Desc"};function te({locale:n="en"}){const{tr:e}=J(n),[u,r]=d.useState("v4"),[o,i]=d.useState("lowercase"),[l,s]=d.useState(1),[m,L]=d.use
1State(!1),[c,C]=d.useState([]),[x,G]=d.useState(null),g=d.useMemo(()=>V(o,m),[o,m]),k=d.useMemo(()=>[{value:"lowercase",label:e("uuidGen.formatLowercase")},{value:"uppercase",label:e("uuidGen.formatUppercase")},{value:"no-hyphens",label:e("uuidGen.formatNoHyphens")}],[e]),z=d.useCallback(()=>{const a=h(l);s(a),C($(u,a,g)),G(null)},[l,g,u]),D=async(a,S)=>{try{await navigator.clipboard.writeText(a),G(S),window.setTimeout(()=>G(null),1600)}catch{}},b=c.join(`
2`),f=c.length>0,N=c.length===1;return t.jsxs("div",{className:"uuid-root",children:[t.jsxs("div",{className:"uuid-card",children:[t.jsxs("fieldset",{className:"uuid-version-fieldset",children:[t.jsx(v,{as:"legend",label:e("uuidGen.versionLabel"),tooltip:e("uuidGen.tooltip.version")}),t.jsx("div",{className:"uuid-version-tabs",role:"radiogroup","aria-label":e("uuidGen.versionLabel"),children:Y.map(a=>t.jsx("button",{type:"button",role:"radio","aria-checked":u===a,className:`uuid-version-tab${u===a?" is-active":""}`,onClick:()=>r(a),children:e(`uuidGen.${a}`)},a))}),t.jsx("p",{className:"uuid-version-desc",children:e(X[u])})]}),t.jsxs("div",{className:"uuid-options-row",children:[t.jsxs("div",{className:"field-group uuid-option",children:[t.jsx(v,{htmlFor:"uuid-format",label:e("uuidGen.formatLabel"),tooltip:e("uuidGen.tooltip.format")}),t.jsx(T,{id:"uuid-format",value:o,options:k,onChange:a=>i(a),className:"uuid-format-select"})]}),t.jsxs("div",{className:"field-group uuid-option",children:[t.jsx(v,{htmlFor:"uuid-count",label:e("uuidGen.countLabel"),tooltip:e("uuidGen.tooltip.count")}),t.jsx("input",{id:"uuid-count",className:"field-input",type:"number",min:U,max:j,value:l,onChange:a=>s(h(Number(a.target.value)))})]}),t.jsxs("label",{className:"checkbox-toggle uuid-braces-toggle",children:[t.jsx("input",{type:"checkbox",checked:m,onChange:a=>L(a.target.checked)}),t.jsxs("span",{className:"uuid-toggle-label",children:[e("uuidGen.braces"),t.jsxs("span",{className:"tooltip-wrapper",tabIndex:0,children:[t.jsx("span",{className:"tooltip-icon","aria-hidden":"true",children:"i"}),t.jsx("span",{className:"tooltip-text",style:{display:"none"},children:e("uuidGen.tooltip.braces")})]})]})]})]}),t.jsx("button",{type:"button",className:"uuid-generate-btn",onClick:z,children:e("uuidGen.generate")})]}),t.jsxs("div",{className:"uuid-results-card",children:[!f&&t.jsx("p",{className:"uuid-empty",children:e("uuidGen.noResults")}),f&&N&&t.jsxs(t.Fragment,{children:[t.jsx("label",{className:"uuid-label",htmlFor:"uuid-single-output",children:e("uuidGen.resultLabel")}),t.jsxs("div",{className:"uuid-single-row",children:[t.jsx("input",{id:"uuid-single-output",className:"field-input uuid-single-output",readOnly:!0,value:c[0]}),t.jsx("button",{type:"button",className:"uuid-action-btn",onClick:()=>{D(c[0],"single")},children:e(x==="single"?"uuidGen.copied":"uuidGen.copy")})]})]}),f&&!N&&t.jsxs(t.Fragment,{children:[t.jsxs("label",{className:"uuid-label",htmlFor:"uuid-batch-output",children:[e("uuidGen.resultsLabel")," (",c.length,")"]}),t.jsx("textarea",{id:"uuid-batch-output",className:"field-input uuid-batch-output",readOnly:!0,rows:Math.min(12,Math.max(4,c.length)),value:b}),t.jsxs("div",{className:"uuid-batch-actions",children:[t.jsx("button",{type:"button",className:"uuid-action-btn",onClick:()=>{D(b,"all")},children:e(x==="all"?"uuidGen.copied":"uuidGen.copyAll")}),t.jsx("button",{type:"button",className:"uuid-action-btn uuid-action-btn--secondary",onClick:()=>H(b,u),children:e("uuidGen.downloadTxt")})]})]})]})]})}export{te as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.