()
| 63 | } |
| 64 | |
| 65 | export function getUUID() { |
| 66 | if (crypto.randomUUID) { |
| 67 | return crypto.randomUUID().replaceAll('-', ''); |
| 68 | } else { |
| 69 | let result = ''; |
| 70 | const buf = new Uint16Array(8); |
| 71 | crypto.getRandomValues(buf); |
| 72 | for (let i = 0; i < buf.length; i++) { |
| 73 | result += buf[i].toString(16); |
| 74 | } |
| 75 | return result; |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | export function encodeHTML(text) { |
| 80 | return String(text) |
no outgoing calls
no test coverage detected