mirror of
https://github.com/skidoodle/safebin.git
synced 2026-04-28 03:07:41 +02:00
fix(web): use web crypto for upload id's
Signed-off-by: skidoodle <contact@albert.lol>
This commit is contained in:
+1
-1
@@ -50,7 +50,7 @@ async function handleUpload(file) {
|
|||||||
$("busy-state").classList.remove("hidden");
|
$("busy-state").classList.remove("hidden");
|
||||||
$("p-bar-container").classList.add("visible");
|
$("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 chunkSize = 1024 * 1024 * 8;
|
||||||
const total = Math.ceil(file.size / chunkSize);
|
const total = Math.ceil(file.size / chunkSize);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user