8 lines
220 B
TypeScript
8 lines
220 B
TypeScript
import { randomUUID, randomFillSync } from 'crypto';
|
|
|
|
if (!(globalThis as any).crypto) {
|
|
(globalThis as any).crypto = {
|
|
randomUUID,
|
|
getRandomValues: (buffer: Uint8Array) => randomFillSync(buffer),
|
|
} as any;
|
|
} |