UNPKG

@criipto/verify-react

Version:

Verify SDK for React Single Page Applications

13 lines (10 loc) 298 B
import webcrypto from 'node:crypto'; Object.defineProperty(globalThis, "crypto", { value: webcrypto }); if (!("getRandomValues" in webcrypto)) { (webcrypto as any).getRandomValues = (arr: Uint8Array) => { const bytes = require('crypto').randomBytes(arr.length) arr.fill(bytes); } }