close to final version added the subtaskand comment working section

This commit is contained in:
tusuii
2026-02-16 19:50:23 +05:30
parent 6aec1445e9
commit 1788e364f1
28 changed files with 5867 additions and 133 deletions

23
server/polyfill.js Normal file
View File

@@ -0,0 +1,23 @@
// Polyfill for crypto in Wizer environment
if (!globalThis.crypto) {
globalThis.crypto = {
getRandomValues: (buffer) => {
// Check if buffer is valid
if (!buffer || typeof buffer.length !== 'number') {
throw new Error("crypto.getRandomValues: invalid buffer");
}
// Fill with pseudo-random numbers
for (let i = 0; i < buffer.length; i++) {
buffer[i] = Math.floor(Math.random() * 256);
}
return buffer;
},
randomUUID: () => {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
};
console.log("Polyfilled globalThis.crypto for Wizer/Spin");
}