(byteLength: number = 16)
| 168 | } |
| 169 | |
| 170 | function generateRandomHexString(byteLength: number = 16): string { |
| 171 | return Array.from(crypto.getRandomValues(new Uint8Array(byteLength)), byte => |
| 172 | byte.toString(16).padStart(2, '0'), |
| 173 | ).join('') |
| 174 | } |
| 175 | |
| 176 | /** |
| 177 | * This function ensures that an oauth state was indeed encoded for the browser |