chore: use 16 bit integer for tag

This commit is contained in:
Adhiraj Singh
2022-04-23 12:45:27 +05:30
parent 21f163d6cf
commit 5e41d3d284

View File

@@ -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 } = {