diff --git a/lib/index.ts b/lib/index.ts index 0835321..e5b4627 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -117,7 +117,7 @@ export function decodeTime(id: string): number { export function detectPrng(allowInsecure: boolean = false, root?: any): PRNG { if (!root) { - root = typeof window !== "undefined" ? window : null + root = typeof self !== "undefined" ? self : null } const browserCrypto = root && (root.crypto || root.msCrypto)