Back
Version 3
11/12/2024
/** @jsxImportSource npm:hono/jsx */
import { fetch } from "https://esm.town/v/std/fetch";
import { faker } from "npm:@faker-js/faker";
import CryptoJS from "npm:crypto-js";
import { Hono } from "npm:hono";
import { timeout } from "npm:hono/timeout";
const commonHeaders = {
"accept": "*/*",
"accept-language": "en-US,en;q=0.9",
"user-agent": faker.internet.userAgent(),
"priority": "u=4, i",
"sec-ch-ua": "\"Not)A;Brand\";v=\"99\", \"Google Chrome\";v=\"127\", \"Chromium\";v=\"127\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"Windows\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"Referrer-Policy": "strict-origin-when-cross-origin",
};
async function uuidGen() {
const randomBytes = CryptoJS.lib.WordArray.random(16);
let hex = randomBytes.toString(CryptoJS.enc.Hex);
hex = hex.replace(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/, "$1-$2-4$3-$4-$5");
hex = hex.replace(/(.{19})[89abAB]/, (match, p1) => p1 + "8");
return hex;
}
async function boundGen() {
const randomBytes = CryptoJS.lib.WordArray.random(16);
const hex = randomBytes.toString(CryptoJS.enc.Hex);
const boundary = "----WebKitFormBoundary" + hex;
return boundary;
}
async function formDataGen(files: File[]) {
const boundary = await boundGen();
temptemp-workers.web.val.run
Updated: November 22, 2024