MCPcopy Create free account
hub / github.com/error311/FileRise / makeUploadId

Function makeUploadId

public/js/sharedDropView.js:468–483  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

466 }
467
468 function makeUploadId() {
469 try {
470 if (window.crypto && typeof window.crypto.randomUUID === 'function') {
471 return window.crypto.randomUUID().replace(/-/g, '');
472 }
473 if (window.crypto && typeof window.crypto.getRandomValues === 'function') {
474 const arr = new Uint8Array(16);
475 window.crypto.getRandomValues(arr);
476 return Array.from(arr).map((n) => n.toString(16).padStart(2, '0')).join('');
477 }
478 } catch (e) {
479 // ignore
480 }
481 uploadSequence += 1;
482 return 'upl' + String(Date.now()) + '_' + String(uploadSequence);
483 }
484
485 async function uploadSingle(item) {
486 const formData = new FormData();

Callers 2

uploadChunkedFunction · 0.85
enqueueFilesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected