diff --git a/src/common/utils/MessageUnique.ts b/src/common/utils/MessageUnique.ts index 30a65cb4..30c4d09d 100644 --- a/src/common/utils/MessageUnique.ts +++ b/src/common/utils/MessageUnique.ts @@ -74,7 +74,7 @@ class MessageUniqueWrapper { createMsg(peer: Peer, msgId: string): number | undefined { const key = `${msgId}|${peer.chatType}|${peer.peerUid}`; const hash = crypto.createHash('sha1').update(key); - const shortId = parseInt(hash.digest('hex').slice(0, 8), 16); + const shortId = Buffer.from(hash.digest('hex').slice(0, 8),'hex').readInt32BE(); const isExist = this.msgIdMap.getKey(shortId); //console.log(`${peer.peerUid} ${msgId} ------- ${shortId}`); if (isExist && isExist === msgId) {