fix(web): use web crypto for upload id's

Signed-off-by: skidoodle <contact@albert.lol>
This commit is contained in:
2026-01-18 22:30:20 +01:00
parent d18ef48bd4
commit 2d6a3ab216
+1 -1
View File
@@ -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);