()
| 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(); |
no outgoing calls
no test coverage detected