From 2d6a3ab21689c19364e823a3601d790c815ce3bd Mon Sep 17 00:00:00 2001 From: skidoodle Date: Sun, 18 Jan 2026 22:30:20 +0100 Subject: [PATCH] fix(web): use web crypto for upload id's Signed-off-by: skidoodle --- web/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/app.js b/web/app.js index adc3a14..072efe4 100644 --- a/web/app.js +++ b/web/app.js @@ -50,7 +50,7 @@ async function handleUpload(file) { $("busy-state").classList.remove("hidden"); $("p-bar-container").classList.add("visible"); - const uploadID = Math.random().toString(36).substring(2, 15); + const uploadID = Array.from(window.crypto.getRandomValues(new Uint8Array(16)), (b) => b.toString(16).padStart(2, "0")).join(""); const chunkSize = 1024 * 1024 * 8; const total = Math.ceil(file.size / chunkSize);