1 parent cb4b7ff commit c9f1ed6Copy full SHA for c9f1ed6
src/webcrypto.ts
@@ -22,7 +22,7 @@ export function randomBytes(bytesLength = 32): Uint8Array {
22
}
23
// Legacy Node.js compatibility
24
if (crypto && typeof crypto.randomBytes === 'function') {
25
- return crypto.randomBytes(bytesLength);
+ return Uint8Array.from(crypto.randomBytes(bytesLength));
26
27
throw new Error('crypto.getRandomValues must be defined');
28
0 commit comments