Update crypto.mjs

This commit is contained in:
Jarred Sumner
2022-09-14 19:24:56 -07:00
parent a31eb6a80c
commit 4e8bd97d9c

View File

@@ -1,10 +1,10 @@
// so it can run in environments without node module resolution
import { bench, run } from "../node_modules/mitata/src/cli.mjs";
var crypto = require("crypto");
var crypto = globalThis.crytpto;
if (!crypto.getRandomValues) {
crypto.getRandomValues = globalThis.crypto.getRandomValues;
if (!crypto) {
crypto = await import("node:crypto");
}
var foo = new Uint8Array(65536);