()
| 63 | } |
| 64 | |
| 65 | function detectRoot(): any { |
| 66 | if (inWebWorker()) return self; |
| 67 | if (typeof window !== "undefined") { |
| 68 | return window; |
| 69 | } |
| 70 | if (typeof global !== "undefined") { |
| 71 | return global; |
| 72 | } |
| 73 | if (typeof globalThis !== "undefined") { |
| 74 | return globalThis; |
| 75 | } |
| 76 | return null; |
| 77 | } |
| 78 | |
| 79 | export function encodeRandom(len: number, prng: PRNG): string { |
| 80 | let str = ""; |
no test coverage detected