Skip to content
This repository has been archived by the owner on Aug 26, 2023. It is now read-only.

Commit

Permalink
best
Browse files Browse the repository at this point in the history
  • Loading branch information
big cock committed Aug 20, 2023
1 parent 0f4c149 commit 27b4f9c
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/routes/api/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,6 @@ interface Keys {
created_at: string;
}

function generateRandomName(length: number): string {
let result = "";
const characters =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
const charactersLength = characters.length;
for (let i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
}

const router: Router = Router();

router.post("/", (req: Request, res: Response) => {
Expand Down Expand Up @@ -102,4 +91,15 @@ router.post("/", (req: Request, res: Response) => {
}
});

function generateRandomName(length: number): string {
let result = "";
const characters =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
const charactersLength = characters.length;
for (let i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
}

export default router;

0 comments on commit 27b4f9c

Please sign in to comment.