completionId: cgen-edfe33e2231a4ed7aea8049819ca2464

cgen-edfe33e2231a4ed7aea8049819ca2464
This commit is contained in:
Builder.io 2025-11-15 02:13:54 +00:00
parent aaac82137c
commit 9e63061e45

View file

@ -190,6 +190,28 @@
</script>
<!-- Discord SDK is imported in DiscordActivityContext.tsx from @discord/embedded-app-sdk npm package -->
<!-- Polyfill for crypto.randomUUID for compatibility -->
<script>
if (!crypto.randomUUID) {
crypto.randomUUID = function () {
const array = new Uint8Array(16);
crypto.getRandomValues(array);
array[6] = (array[6] & 0x0f) | 0x40;
array[8] = (array[8] & 0x3f) | 0x80;
const hex = Array.from(array).map((b) =>
b.toString(16).padStart(2, "0")
);
return [
hex.slice(0, 4).join(""),
hex.slice(4, 6).join(""),
hex.slice(6, 8).join(""),
hex.slice(8, 10).join(""),
hex.slice(10, 16).join(""),
].join("-");
};
}
</script>
</head>
<body>