diff --git a/src/cdn/routes/app-assets.ts b/src/cdn/routes/app-assets.ts
index 149d8b35..0764d520 100644
--- a/src/cdn/routes/app-assets.ts
+++ b/src/cdn/routes/app-assets.ts
@@ -43,7 +43,7 @@ router.post("/:guild_id", multer.single("file"), async (req: Request, res: Respo
const { buffer, size } = req.file;
const { guild_id } = req.params as { [key: string]: string };
- let hash = crypto.createHash("md5").update(Snowflake.generate()).digest("hex");
+ let hash = crypto.createHash("md5").update(buffer).digest("hex");
const type = await fileTypeFromBuffer(buffer);
if (!type || !ALLOWED_MIME_TYPES.includes(type.mime)) throw new HTTPError("Invalid file type");
diff --git a/src/cdn/routes/app-icons.ts b/src/cdn/routes/app-icons.ts
index b67bc1fb..300d4bda 100644
--- a/src/cdn/routes/app-icons.ts
+++ b/src/cdn/routes/app-icons.ts
@@ -43,7 +43,7 @@ router.post("/:guild_id", multer.single("file"), async (req: Request, res: Respo
const { buffer, size } = req.file;
const { guild_id } = req.params as { [key: string]: string };
- let hash = crypto.createHash("md5").update(Snowflake.generate()).digest("hex");
+ let hash = crypto.createHash("md5").update(buffer).digest("hex");
const type = await fileTypeFromBuffer(buffer);
if (!type || !ALLOWED_MIME_TYPES.includes(type.mime)) throw new HTTPError("Invalid file type");
diff --git a/src/cdn/routes/avatars.ts b/src/cdn/routes/avatars.ts
index f2d539bd..9fc74bf6 100644
--- a/src/cdn/routes/avatars.ts
+++ b/src/cdn/routes/avatars.ts
@@ -42,7 +42,7 @@ router.post("/:user_id", multer.single("file"), async (req: Request, res: Respon
const { buffer, size } = req.file;
const { user_id } = req.params as { [key: string]: string };
- let hash = crypto.createHash("md5").update(Snowflake.generate()).digest("hex");
+ let hash = crypto.createHash("md5").update(buffer).digest("hex");
const type = await fileTypeFromBuffer(buffer);
if (!type || !ALLOWED_MIME_TYPES.includes(type.mime)) throw new HTTPError("Invalid file type");
diff --git a/src/cdn/routes/banners.ts b/src/cdn/routes/banners.ts
index 979bdad0..89bd8bc0 100644
--- a/src/cdn/routes/banners.ts
+++ b/src/cdn/routes/banners.ts
@@ -43,7 +43,7 @@ router.post("/:guild_id", multer.single("file"), async (req: Request, res: Respo
const { buffer, size } = req.file;
const { guild_id } = req.params as { [key: string]: string };
- let hash = crypto.createHash("md5").update(Snowflake.generate()).digest("hex");
+ let hash = crypto.createHash("md5").update(buffer).digest("hex");
const type = await fileTypeFromBuffer(buffer);
if (!type || !ALLOWED_MIME_TYPES.includes(type.mime)) throw new HTTPError("Invalid file type");
diff --git a/src/cdn/routes/channel-icons.ts b/src/cdn/routes/channel-icons.ts
index 3b85d4e4..587a0964 100644
--- a/src/cdn/routes/channel-icons.ts
+++ b/src/cdn/routes/channel-icons.ts
@@ -43,7 +43,7 @@ router.post("/:guild_id", multer.single("file"), async (req: Request, res: Respo
const { buffer, size } = req.file;
const { guild_id } = req.params as { [key: string]: string };
- let hash = crypto.createHash("md5").update(Snowflake.generate()).digest("hex");
+ let hash = crypto.createHash("md5").update(buffer).digest("hex");
const type = await fileTypeFromBuffer(buffer);
if (!type || !ALLOWED_MIME_TYPES.includes(type.mime)) throw new HTTPError("Invalid file type");
diff --git a/src/cdn/routes/discover-splashes.ts b/src/cdn/routes/discover-splashes.ts
index e9c07cb1..ee6e0af5 100644
--- a/src/cdn/routes/discover-splashes.ts
+++ b/src/cdn/routes/discover-splashes.ts
@@ -43,7 +43,7 @@ router.post("/:guild_id", multer.single("file"), async (req: Request, res: Respo
const { buffer, size } = req.file;
const { guild_id } = req.params as { [key: string]: string };
- let hash = crypto.createHash("md5").update(Snowflake.generate()).digest("hex");
+ let hash = crypto.createHash("md5").update(buffer).digest("hex");
const type = await fileTypeFromBuffer(buffer);
if (!type || !ALLOWED_MIME_TYPES.includes(type.mime)) throw new HTTPError("Invalid file type");
diff --git a/src/cdn/routes/discovery-splashes.ts b/src/cdn/routes/discovery-splashes.ts
index 9d6d81c7..32dfb9b2 100644
--- a/src/cdn/routes/discovery-splashes.ts
+++ b/src/cdn/routes/discovery-splashes.ts
@@ -43,7 +43,7 @@ router.post("/:guild_id", multer.single("file"), async (req: Request, res: Respo
const { buffer, size } = req.file;
const { guild_id } = req.params as { [key: string]: string };
- let hash = crypto.createHash("md5").update(Snowflake.generate()).digest("hex");
+ let hash = crypto.createHash("md5").update(buffer).digest("hex");
const type = await fileTypeFromBuffer(buffer);
if (!type || !ALLOWED_MIME_TYPES.includes(type.mime)) throw new HTTPError("Invalid file type");
diff --git a/src/cdn/routes/emojis.ts b/src/cdn/routes/emojis.ts
index f11af3ba..074e727d 100644
--- a/src/cdn/routes/emojis.ts
+++ b/src/cdn/routes/emojis.ts
@@ -43,7 +43,7 @@ router.post("/:emoji_id", multer.single("file"), async (req: Request, res: Respo
const { buffer, size } = req.file;
const { emoji_id } = req.params as { [key: string]: string };
- let hash = crypto.createHash("md5").update(Snowflake.generate()).digest("hex");
+ let hash = crypto.createHash("md5").update(buffer).digest("hex");
const type = await fileTypeFromBuffer(buffer);
if (!type || !ALLOWED_MIME_TYPES.includes(type.mime)) throw new HTTPError("Invalid file type");
diff --git a/src/cdn/routes/guild-profiles.ts b/src/cdn/routes/guild-profiles.ts
index 9d27debf..d96a6ddc 100644
--- a/src/cdn/routes/guild-profiles.ts
+++ b/src/cdn/routes/guild-profiles.ts
@@ -42,7 +42,7 @@ router.post("/", multer.single("file"), async (req: Request, res: Response) => {
const { buffer, size } = req.file;
const { guild_id, user_id } = req.params as { [key: string]: string };
- let hash = crypto.createHash("md5").update(Snowflake.generate()).digest("hex");
+ let hash = crypto.createHash("md5").update(buffer).digest("hex");
const type = await fileTypeFromBuffer(buffer);
if (!type || !ALLOWED_MIME_TYPES.includes(type.mime)) throw new HTTPError("Invalid file type");
diff --git a/src/cdn/routes/icons.ts b/src/cdn/routes/icons.ts
index 6ddd49e9..727497f8 100644
--- a/src/cdn/routes/icons.ts
+++ b/src/cdn/routes/icons.ts
@@ -43,7 +43,7 @@ router.post("/:guild_id", multer.single("file"), async (req: Request, res: Respo
const { buffer, size } = req.file;
const { guild_id } = req.params as { [key: string]: string };
- let hash = crypto.createHash("md5").update(Snowflake.generate()).digest("hex");
+ let hash = crypto.createHash("md5").update(buffer).digest("hex");
const type = await fileTypeFromBuffer(buffer);
if (!type || !ALLOWED_MIME_TYPES.includes(type.mime)) throw new HTTPError("Invalid file type");
diff --git a/src/cdn/routes/splashes.ts b/src/cdn/routes/splashes.ts
index a10709d7..44626dc7 100644
--- a/src/cdn/routes/splashes.ts
+++ b/src/cdn/routes/splashes.ts
@@ -43,7 +43,7 @@ router.post("/:guild_id", multer.single("file"), async (req: Request, res: Respo
const { buffer, size } = req.file;
const { guild_id } = req.params as { [key: string]: string };
- let hash = crypto.createHash("md5").update(Snowflake.generate()).digest("hex");
+ let hash = crypto.createHash("md5").update(buffer).digest("hex");
const type = await fileTypeFromBuffer(buffer);
if (!type || !ALLOWED_MIME_TYPES.includes(type.mime)) throw new HTTPError("Invalid file type");
diff --git a/src/cdn/routes/stickers.ts b/src/cdn/routes/stickers.ts
index a9206949..2ffa92fc 100644
--- a/src/cdn/routes/stickers.ts
+++ b/src/cdn/routes/stickers.ts
@@ -43,7 +43,7 @@ router.post("/:sticker_id", multer.single("file"), async (req: Request, res: Res
const { buffer, size } = req.file;
const { sticker_id } = req.params as { [key: string]: string };
- let hash = crypto.createHash("md5").update(Snowflake.generate()).digest("hex");
+ let hash = crypto.createHash("md5").update(buffer).digest("hex");
const type = await fileTypeFromBuffer(buffer);
if (!type || !ALLOWED_MIME_TYPES.includes(type.mime)) throw new HTTPError("Invalid file type");
diff --git a/src/cdn/routes/team-icons.ts b/src/cdn/routes/team-icons.ts
index c0e7e785..de5f0225 100644
--- a/src/cdn/routes/team-icons.ts
+++ b/src/cdn/routes/team-icons.ts
@@ -43,7 +43,7 @@ router.post("/:guild_id", multer.single("file"), async (req: Request, res: Respo
const { buffer, size } = req.file;
const { guild_id } = req.params as { [key: string]: string };
- let hash = crypto.createHash("md5").update(Snowflake.generate()).digest("hex");
+ let hash = crypto.createHash("md5").update(buffer).digest("hex");
const type = await fileTypeFromBuffer(buffer);
if (!type || !ALLOWED_MIME_TYPES.includes(type.mime)) throw new HTTPError("Invalid file type");
diff --git a/src/cdn/util/basicCrdFileRouter.ts b/src/cdn/util/basicCrdFileRouter.ts
index 7490d546..1d2f76b7 100644
--- a/src/cdn/util/basicCrdFileRouter.ts
+++ b/src/cdn/util/basicCrdFileRouter.ts
@@ -51,7 +51,7 @@ export function createBasicCrdFileRouter(opts: BasicCrdFileRouterOptions) {
const { buffer, size } = req.file;
const { user_id } = req.params as { [key: string]: string };
- let hash = crypto.createHash("md5").update(Snowflake.generate()).digest("hex");
+ let hash = crypto.createHash("md5").update(buffer).digest("hex");
const type = await fileTypeFromBuffer(buffer);
if (!type || !ALLOWED_MIME_TYPES.includes(type.mime)) throw new HTTPError("Invalid file type");
|