()
| 72 | } |
| 73 | |
| 74 | function uuid() { |
| 75 | if (crypto.randomUUID) return crypto.randomUUID(); |
| 76 | return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => { |
| 77 | const r = (Math.random() * 16) | 0; |
| 78 | const v = c === "x" ? r : (r & 0x3) | 0x8; |
| 79 | return v.toString(16); |
| 80 | }); |
| 81 | } |
| 82 | |
| 83 | function taskSignHeaders(data = {}) { |
| 84 | const payload = { ...data }; |