From 5e41d3d2848f28b9504dd19f0863b45f8307aa6f Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Sat, 23 Apr 2022 12:45:27 +0530 Subject: [PATCH] chore: use 16 bit integer for tag --- src/Utils/generics.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Utils/generics.ts b/src/Utils/generics.ts index d9c5ce4..82622c7 100644 --- a/src/Utils/generics.ts +++ b/src/Utils/generics.ts @@ -243,8 +243,8 @@ export const fetchLatestBaileysVersion = async() => { /** unique message tag prefix for MD clients */ export const generateMdTagPrefix = () => { - const bytes = randomBytes(2) - return `${bytes[0]}.${bytes[1]}-` + const bytes = randomBytes(4) + return `${bytes.readUInt16BE()}.${bytes.readUInt16BE(2)}-` } const STATUS_MAP: { [_: string]: proto.WebMessageInfo.WebMessageInfoStatus } = {